slackbuilds

My Slackbuilds
git clone git://git.server.ky/slackcoder/slackbuilds
Log | Files | Refs | README

rc.efi-sync.new (1174B)


      1 #!/bin/sh
      2 #
      3 # Startup/shutdown script for GNU Taler's exchange.
      4 #
      5 
      6 # Seconds to wait for daemon to shutdown.
      7 SHUTDOWN_WAIT=60
      8 
      9 mkdir -p /run/efi-sync
     10 
     11 start() {
     12   echo "Starting EFI Sync"
     13 
     14   daemon \
     15     --name=efi-sync \
     16     --pidfiles=/run/efi-sync \
     17     --output=/var/log/efi-sync.log \
     18     -- efi-sync watch
     19 }
     20 
     21 stop() {
     22   echo "Stopping EFI Sync"
     23 
     24   if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
     25   	/usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --stop
     26   fi
     27 
     28   # Wait for daemon to politely shutdown.
     29   sleep 1
     30   if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running; then
     31     echo "Waiting up to ${SHUTDOWN_WAIT} to stop..."
     32 
     33     let "count = 0"
     34     while /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running && [[ $count -lt 60 ]]; do
     35       sleep 1
     36       let "count = $count + 1"
     37     done
     38   fi
     39 }
     40 
     41 status() {
     42   if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
     43   	/usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running --verbose
     44   fi
     45 }
     46 
     47 case "$1" in
     48 start)
     49 	start
     50 	;;
     51 stop)
     52 	stop
     53 	;;
     54 status)
     55 	status
     56 	;;
     57 *)
     58 	echo $"Usage: $0 {start|stop|status}"
     59 	exit 1
     60 esac