@@ -19,11 +19,11 @@ get_datetime() {
1919
2020# Strip spaces from datetime
2121sanitize_datetime () {
22- echo $1 | sed s/" " /" " /g
22+ echo " $1 " | sed s/" " /" " /g
2323}
2424
2525# Print usage if parameters are not provided
26- if [ -z $1 ] || [ -z $2 ] ; then
26+ if [ -z " $1 " ] || [ -z " $2 " ] ; then
2727 echo " Set up a crontab entry for regulary saving the time"
2828 echo " Usage $0 <path to piratebox.conf> <step>"
2929 echo " Valid steps are:"
@@ -35,7 +35,7 @@ if [ -z $1 ] || [ -z $2 ] ; then
3535fi
3636
3737# Load configfile
38- . $1
38+ . " $1 "
3939
4040if [ " $2 " = " install" ] ; then
4141 crontab -l > $PIRATEBOX_FOLDER /tmp/crontab 2> /dev/null
@@ -44,9 +44,9 @@ if [ "$2" = "install" ] ; then
4444 crontab $PIRATEBOX_FOLDER /tmp/crontab
4545
4646 echo " initialize timesave file"
47- touch $TIMESAVE
48- chmod a+rw $TIMESAVE
49- get_datetime > $TIMESAVE
47+ touch " $TIMESAVE "
48+ chmod a+rw " $TIMESAVE "
49+ get_datetime > " $TIMESAVE "
5050
5151 echo " Remember MAY have to cron active..."
5252 echo " on OpenWrt run: /etc/init.d/piratebox enable"
5656
5757# Save current date-time in a recoverable format
5858if [ " $2 " = " save" ] ; then
59- if [ -e $TIMESAVE ] ; then
59+ if [ -e " $TIMESAVE " ] ; then
6060 if [ $( sanitize_datetime " $( get_datetime) " ) -lt $( sanitize_datetime " $( cat $TIMESAVE ) " ) ] ; then
6161 logger -s " $0 : Current date-time is lower then saved one. Not saving!"
6262 exit 1
6363 fi
6464 fi
6565
66- get_datetime > $TIMESAVE
66+ get_datetime > " $TIMESAVE "
6767 exit 0
6868fi
6969
0 commit comments