nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
This commit is contained in:
parent
550eed06e0
commit
ee178b7d57
190 changed files with 5 additions and 6 deletions
59
unprocessed/termux/services/crond
Executable file
59
unprocessed/termux/services/crond
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/data/data/com.termux/files/usr/bin/bash
|
||||
#
|
||||
# Start crond
|
||||
#
|
||||
|
||||
PIDFILE="$HOME/.local/run/crond.pid"
|
||||
LOGFILE="$HOME/.local/log/crond.log"
|
||||
|
||||
start() {
|
||||
printf "Starting crond: "
|
||||
start-stop-daemon -p "$PIDFILE" -x crond -S -b -m -- -f -L "$LOGFILE"
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping crond: "
|
||||
start-stop-daemon -p "$PIDFILE" -x crond -K
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
status() {
|
||||
printf "crond: "
|
||||
PID="$(cat "$PIDFILE" 2> /dev/null)"
|
||||
if [[ -n "$PID" && -d "/proc/$PID" ]]
|
||||
then
|
||||
echo "running"
|
||||
else
|
||||
echo "stopped"
|
||||
fi
|
||||
}
|
||||
|
||||
log() {
|
||||
tail "$@" "$LOGFILE"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
log)
|
||||
shift
|
||||
log "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|log}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
Loading…
Add table
Add a link
Reference in a new issue