diff options
Diffstat (limited to 'net-irc/iroffer-dinoex/files/iroffer-dinoex.init')
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex.init | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex.init b/net-irc/iroffer-dinoex/files/iroffer-dinoex.init new file mode 100644 index 000000000000..ea6363c71d13 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex.init @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="reload reconnect" + +description_reload="Reload the config file" +description_reconnect="Force reconnection to an IRC server" + +depend() { + need net +} + +start_pre() { + if [ ! -f "${MYBOT}" ]; then + eerror "${MYBOT} not found" + return 1 + fi + + checkpath -d -o "${USER}":"${GROUP}" /var/run/iroffer-dinoex + checkpath -d -o "${USER}":"${GROUP}" /var/log/iroffer-dinoex + checkpath -d -o "${USER}":"${GROUP}" /var/lib/iroffer-dinoex +} + +start() { + ebegin "Starting iroffer-dinoex" + start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --user "${USER}:${GROUP}" --exec "${BIN}" -- -b "${MYBOT}" -w "${STATE}" -s + eend $? +} + +stop() { + ebegin "Stopping iroffer-dinoex" + start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${BIN}" + eend $? +} + +reload(){ + ebegin "Reload iroffer-dinoex" + start-stop-daemon --signal SIGUSR2 --pidfile "${PIDFILE}" + eend $? +} + +reconnect(){ + ebegin "Try to reconnect iroffer-dinoex to servers" + start-stop-daemon --signal SIGUSR1 --pidfile "${PIDFILE}" + eend $? +} |