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