mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-02 13:04:42 +01:00
ba75814fbf
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
45 lines
757 B
Bash
45 lines
757 B
Bash
#!/bin/sh
|
|
#
|
|
# ddclient This shell script takes care of starting and stopping
|
|
# ddclient.
|
|
#
|
|
# ddclient provides support for updating dynamic DNS services.
|
|
|
|
[ -f /etc/ddclient/ddclient.conf ] || exit 1
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting ddclient: "
|
|
# ddclient -verbose
|
|
ddclient
|
|
echo
|
|
;;
|
|
stop)
|
|
echo -n "Shutting down ddclient: "
|
|
#kill $( ps -aef | grep ddclient | grep sleeping | awk '{print$2}' )
|
|
pkill ddclient
|
|
echo
|
|
;;
|
|
restart)
|
|
sh $0 stop
|
|
sh $0 start
|
|
;;
|
|
status)
|
|
pids=$(pgrep ddclient)
|
|
if test "$pids"
|
|
then
|
|
for p in $pids
|
|
do
|
|
echo "ddclient (pid $p) is running."
|
|
ps up $p
|
|
done
|
|
else
|
|
echo "ddclient is stopped."
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: ddclient {start|stop|restart|status}"
|
|
exit 1
|
|
esac
|
|
|
|
exit 0
|