mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
27 lines
343 B
Bash
Executable file
27 lines
343 B
Bash
Executable file
#!/bin/bash
|
|
|
|
THISFILE=$0
|
|
|
|
setclock() {
|
|
echo "Setting clock."
|
|
MYTIME=$(date -r $THISFILE '+%Y-%m-%d %H:%M:%S')
|
|
date --set="$MYTIME" &>/dev/null
|
|
}
|
|
|
|
saveclock() {
|
|
echo "Saving current time."
|
|
touch $THISFILE &>/dev/null
|
|
}
|
|
|
|
case "$1" in
|
|
set)
|
|
setclock
|
|
;;
|
|
save)
|
|
saveclock
|
|
;;
|
|
*)
|
|
echo "Usage: $THISFILE {set|save}"
|
|
exit 1
|
|
;;
|
|
esac
|