diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-09-16 08:02:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-09-16 08:02:10 +0000 |
commit | b437ffce4103fb116a27506fe3d21e91031b59bf (patch) | |
tree | e2c5ff6ad7098aa3d6072ed17a66fba7413f809d /main/aiccu/aiccu.initd | |
parent | dc93e81cd095b0506ebead1de16797a96fcbdb00 (diff) | |
download | aports-b437ffce4103fb116a27506fe3d21e91031b59bf.tar.bz2 aports-b437ffce4103fb116a27506fe3d21e91031b59bf.tar.xz |
main/aiccu: moved from testing
Diffstat (limited to 'main/aiccu/aiccu.initd')
-rw-r--r-- | main/aiccu/aiccu.initd | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/main/aiccu/aiccu.initd b/main/aiccu/aiccu.initd new file mode 100644 index 0000000000..1c8dec0105 --- /dev/null +++ b/main/aiccu/aiccu.initd @@ -0,0 +1,40 @@ +#!/sbin/runscript + +depend() { + need net + after ntpd +} + +checkconfig() { + # Verify that the configuration file exists + if [ ! -f /etc/aiccu.conf ]; then + eerror "AICCU Configuration file /etc/aiccu.conf doesn't exist" + return 1 + fi + + # Verify that the configuration is correct + if [ `grep -c "^username" /etc/aiccu.conf 2>/dev/null` -ne 1 ]; then + eerror "AICCU is not configured, edit /etc/aiccu.conf first" + return 1 + fi +} + + +start() { + checkconfig || return 1 + ebegin "Starting aiccu" + start-stop-daemon --start --quiet --exec /usr/sbin/aiccu -- start + eend $? +} + +stop() { + ebegin "Stopping aiccu" + start-stop-daemon --stop --pidfile /var/run/aiccu.pid --quiet --exec /usr/sbin/aiccu -- stop + eend $? +} + +restart() { + stop + sleep 3 + start +} |