radicale.hotplug (530B)
1 #!/bin/sh 2 3 # only (re-)start on ifup 4 [ "$ACTION" = "ifup" ] || exit 0 5 # only start if boot_delay is done 6 [ -f /tmp/radicale.hotplug ] || exit 0 7 8 _PID=$(ps | grep '[p]ython.*[r]adicale' 2>/dev/null | awk '{print $1}') 9 kill -1 $_PID 2>/dev/null 10 if [ $? -eq 0 ]; then 11 # only restart if already running 12 logger -p user.info -t "radicale[$_PID]" \ 13 "Restart request due to '$ACTION' of interface '$INTERFACE'" 14 /etc/init.d/radicale restart 15 else 16 # only start if enabled 17 /etc/init.d/radicale enabled && /etc/init.d/radicale start 18 fi