summaryrefslogtreecommitdiffstats
path: root/network/radicale/rc.radicale
blob: 3fb0515ec2aafa0381020285515007e90f992465 (plain)
#!/bin/sh

# start/stop/restart radicale

radicale_start() {
	daemon -n radicale -u radicale -o local1.warning -e "HOME=/var/lib/radicale" -D /var/lib/radicale -- python3 -m radicale
}

radicale_stop() {
	daemon -n radicale -u radicale --stop
}

radicale_restart() {
  radicale_stop
  sleep 1
  radicale_start
}

case "$1" in
'start')
  radicale_start
  ;;
'stop')
  radicale_stop
  ;;
'restart')
  radicale_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac