summaryrefslogtreecommitdiff
path: root/net-proxy/wireproxy/files/wireproxy.initd
blob: f0031c529729689af6899d06bd8ae328aa3f7224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/sbin/openrc-run
supervisor=supervise-daemon
command=/usr/bin/wireproxy
command_args="-c /etc/wireproxy.conf"
pidfile="/run/${RC_SVCNAME}.pid"
extra_commands="checkconfig"

depend() {
    need net
}

checkconfig() {
    "${command}" ${command_args} -n || { eend $? "Invalid configuration"; return $?; }
}

start_pre() {
    if [ "${RC_CMD}" != "restart" ] ; then
        checkconfig > /dev/null || return $?
    fi
}

stop_pre() {
    if [ "${RC_CMD}" = "restart" ] ; then
        checkconfig > /dev/null || return $?
    fi
}