61 lines
949 B
Plaintext
61 lines
949 B
Plaintext
|
#!/sbin/openrc-run
|
||
|
|
||
|
description="SFS Waterfall proxy"
|
||
|
extra_started_commands="console"
|
||
|
|
||
|
console() {
|
||
|
waterfall-console -f
|
||
|
}
|
||
|
|
||
|
_waterfall_status() {
|
||
|
waterfall-status > /dev/null
|
||
|
}
|
||
|
|
||
|
start_pre() {
|
||
|
mark_service_starting
|
||
|
}
|
||
|
|
||
|
start() {
|
||
|
waterfall-start
|
||
|
}
|
||
|
|
||
|
start_post() {
|
||
|
mark_service_started
|
||
|
}
|
||
|
|
||
|
status() {
|
||
|
if service_stopping; then
|
||
|
ewarn "status: stopping"
|
||
|
return 4
|
||
|
elif service_starting; then
|
||
|
ewarn "status: starting"
|
||
|
return 8
|
||
|
elif service_inactive; then
|
||
|
ewarn "status: inactive"
|
||
|
return 16
|
||
|
elif service_crashed; then
|
||
|
eerror "status: crashed"
|
||
|
return 32
|
||
|
elif ! _waterfall_status; then
|
||
|
mark_service_stopped
|
||
|
einfo "status: stopped"
|
||
|
return 3
|
||
|
else
|
||
|
mark_service_started
|
||
|
einfo "status: started"
|
||
|
return 0
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
stop_pre() {
|
||
|
if _waterfall_status; then
|
||
|
mark_service_started
|
||
|
else
|
||
|
mark_service_stopped
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
service_started && eend "use \`rc-service $RC_SVCNAME console\` and enter the \`end\` command manually"
|
||
|
}
|