ccrr10

ddclient service

Jan 18th, 2021
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/sbin/openrc-run
  2. description="ddclient Daemon for Alpine"
  3. command="/usr/sbin/ddclient"
  4. config_file="/etc/ddclient/ddclient.conf"
  5. command_args=""
  6. pidfile=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 pid= | awk -F '=' '{print $2}')
  7. delay=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 "daemon" | awk -F '=' '{print $2}')
  8.  
  9. if [ -z "${delay}" ]
  10. then
  11. command_args="-daemon 300"
  12. else
  13. command_args=""
  14. fi
  15.  
  16.  
  17. depend() {
  18. use logger
  19. need net
  20. after firewall
  21. }
  22.  
  23. start() {
  24. ebegin "Starting ddclient"
  25. start-stop-daemon --start \
  26. --exec "${command}" \
  27. --pidfile "${pidfile}" \
  28. -- \
  29. ${command_args}
  30. eend $?
  31. }
  32.  
  33. stop() {
  34. ebegin "Stopping ddclient"
  35. start-stop-daemon --stop --exec "${command}" \
  36. --pidfile "${pidfile}"
  37. eend $?
  38. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×