aboutsummaryrefslogtreecommitdiff
path: root/efi-sync/files
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-04-27 13:03:41 -0500
committerSlack Coder <slackcoder@server.ky>2024-04-27 13:04:51 -0500
commit858a5bda88011747edb72de66f70808699177f31 (patch)
tree2defbc9672725341eb7757450a07da030b9b9507 /efi-sync/files
parent70870306dd2f487b75b369153402a5b455915487 (diff)
downloadslackbuilds-858a5bda88011747edb72de66f70808699177f31.tar.xz
efi-sync: Add
Diffstat (limited to 'efi-sync/files')
-rw-r--r--efi-sync/files/rc.efi-sync.new62
1 files changed, 62 insertions, 0 deletions
diff --git a/efi-sync/files/rc.efi-sync.new b/efi-sync/files/rc.efi-sync.new
new file mode 100644
index 0000000..bd301ed
--- /dev/null
+++ b/efi-sync/files/rc.efi-sync.new
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Startup/shutdown script for GNU Taler's exchange.
+#
+
+PATH=$PATH:/usr/local/sbin
+
+# 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