mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-01 01:00:03 +01:00
206336c0bc
Thanks to bjwebb. Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
49 lines
882 B
Bash
49 lines
882 B
Bash
#!/bin/sh
|
|
# Start/stop/restart salt syndic
|
|
|
|
PIDFILE=/var/run/salt-syndic.pid
|
|
LOGFILE=/var/log/salt/syndic
|
|
# LOGLEVEL: One of: all, garbage, trace, debug, info, warning, error, quiet
|
|
LOGLEVEL=warning
|
|
|
|
# Start salt-syndic:
|
|
salt_syndic_start() {
|
|
if [ -x /usr/bin/salt-syndic ]; then
|
|
echo "Starting salt-syndic daemon: /usr/bin/salt-syndic"
|
|
/usr/bin/salt-syndic -d \
|
|
--pid-file=$PIDFILE \
|
|
--log-file=$LOGFILE \
|
|
--log-file-level=$LOGLEVEL
|
|
fi
|
|
}
|
|
|
|
# Stop salt-syndic:
|
|
salt_syndic_stop() {
|
|
if [ -s $PIDFILE ] ; then
|
|
kill $(cat $PIDFILE)
|
|
else
|
|
killall salt-syndic
|
|
fi
|
|
rm -f $PIDFILE
|
|
}
|
|
|
|
# Restart salt-syndic:
|
|
salt_syndic_restart() {
|
|
salt_syndic_stop
|
|
sleep 1
|
|
salt_syndic_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
salt_syndic_start
|
|
;;
|
|
'stop')
|
|
salt_syndic_stop
|
|
;;
|
|
'restart')
|
|
salt_syndic_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|