slackbuilds_ponce/system/efi-sync/files/rc.efi-sync.new
Slack Coder c67b91cac9
system/efi-sync: Added (EFI auto update).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2024-05-04 21:45:20 +07:00

60 lines
1.1 KiB
Bash

#!/bin/sh
#
# Startup/shutdown script for GNU Taler's exchange.
#
# Seconds to wait for daemon to shutdown.
SHUTDOWN_WAIT=60
mkdir -p /run/efi-sync
start() {
echo "Starting EFI Sync"
daemon \
--name=efi-sync \
--pidfiles=/run/efi-sync \
--output=/var/log/efi-sync.log \
-- efi-sync watch
}
stop() {
echo "Stopping EFI Sync"
if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
/usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --stop
fi
# Wait for daemon to politely shutdown.
sleep 1
if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running; then
echo "Waiting up to ${SHUTDOWN_WAIT} to stop..."
let "count = 0"
while /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running && [[ $count -lt 60 ]]; do
sleep 1
let "count = $count + 1"
done
fi
}
status() {
if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
/usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running --verbose
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 1
esac