You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
457 B

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