mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
40 lines
616 B
Text
40 lines
616 B
Text
|
#! /bin/sh
|
||
|
|
||
|
CMD=local-persist
|
||
|
|
||
|
local_persist_start() {
|
||
|
if [ -n "$(/sbin/pidof $CMD)" ]; then
|
||
|
echo >&2 "$0: $CMD is already running"
|
||
|
else
|
||
|
/usr/bin/$CMD | /usr/bin/logger -t $CMD -p daemon.info &
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
local_persist_stop() {
|
||
|
/usr/bin/pkill $CMD
|
||
|
}
|
||
|
|
||
|
local_persist_status() {
|
||
|
pid=$(/sbin/pidof $CMD)
|
||
|
if [ -n "$pid" ]; then
|
||
|
echo "$CMD is running (pid $pid)"
|
||
|
else
|
||
|
echo "$CMD is not running"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
case $1 in
|
||
|
start)
|
||
|
local_persist_start
|
||
|
;;
|
||
|
stop)
|
||
|
local_persist_stop
|
||
|
;;
|
||
|
restart)
|
||
|
local_persist_stop
|
||
|
local_persist_start
|
||
|
;;
|
||
|
status)
|
||
|
local_persist_status
|
||
|
esac
|