File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
general/package/fake-hwclock-openipc/files Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
33if [[ $# -lt 2 ]]; then
4- exit 1
4+ exit 1
55fi
66
77MODE=" $1 "
@@ -10,19 +10,19 @@ TIMESTAMP_FILE="$2"
1010mkdir -p " $( dirname " $TIMESTAMP_FILE " ) "
1111
1212if [[ " $MODE " == " load" ]]; then
13- if [[ -f " $TIMESTAMP_FILE " ]]; then
14- LAST_TS=$( cat " $TIMESTAMP_FILE " )
15- if [[ -n " $LAST_TS " ]]; then
16- echo " fake-hwclock: Setting time to $( date -d @" $LAST_TS " ) "
13+ if [[ -f " $TIMESTAMP_FILE " ]]; then
14+ LAST_TS=$( cat " $TIMESTAMP_FILE " )
15+ if [[ -n " $LAST_TS " ]]; then
16+ echo " fake-hwclock: Setting time to $( date -d @" $LAST_TS " ) "
1717 date -s @" $LAST_TS " > /dev/null 2>&1
18- fi
19- fi
18+ fi
19+ fi
2020elif [[ " $MODE " == " save" ]]; then
21- date +%s > " $TIMESTAMP_FILE "
21+ date +%s > " $TIMESTAMP_FILE "
2222elif [[ " $MODE " =~ ^[0-9]+$ ]]; then
23- INTERVAL=" $MODE "
24- while true ; do
25- date +%s > " $TIMESTAMP_FILE "
26- sleep " $INTERVAL "
27- done
23+ INTERVAL=" $MODE "
24+ while true ; do
25+ date +%s > " $TIMESTAMP_FILE "
26+ sleep " $INTERVAL "
27+ done
2828fi
You can’t perform that action at this time.
0 commit comments