Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/sh
  2. SERVICE='inadyn'
  3.  
  4. if ps ax | grep -v grep | grep $SERVICE > /dev/null
  5. then
  6.     echo "$SERVICE is running, everything is fine"
  7. else
  8.     echo "$SERVICE is not running"
  9.     # Inadyn DDNS fix
  10.     sleep 20
  11.     if [ -e /tmp/ddns/inadyn.conf ]; then
  12.         cd /tmp/ddns && mv inadyn.conf inadyn.backup
  13.         sed 's/ --cache_dir \/tmp\/ddns//' inadyn.backup | tee -i inadyn.conf
  14.         /opt/bin/inadyn --input_file /tmp/ddns/inadyn.conf
  15.     fi
  16.     echo "$SERVICE is now started"
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement