lfs-execline-scripts

Repository for execline scripts used in my linux-from-scratch builds
Log | Files | Refs

hwclock (585B)


      1 #!/usr/bin/execlineb -S1
      2 # Use execlineb -WS1 for debug/testing (errors out on bad syntax)
      3 importas -S PATH
      4 
      5 # set PID to pid of running process (may (not) exist)
      6 #backtick PID { pidof -o %PPID $bins }
      7 
      8 envfile /etc/svc.d/default/hwclock.conf
      9 
     10 case -N -- $1
     11 {
     12 	"-s" { # start case
     13 		foreground { printf "Setting system clock...\n" }
     14 		foreground { hwclock $HWCLOCK_UP /dev/rtc0 }
     15 	}
     16 	"-k" { # kill case
     17 		foreground { printf "Saving system clock...\n" }
     18 		foreground { hwclock $HWCLOCK_DOWN /dev/rtc0 }
     19 	}
     20 } # default case
     21 foreground { /usr/bin/printf "usage: %s -s|-k\n" "$0" } exit 1