You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
#!@l_prefix@/bin/openpkg rc |
|
## |
|
## rc.icecast -- Run-Commands |
|
## |
|
|
|
%config |
|
icecast_enable="$openpkg_rc_def" |
|
|
|
%common |
|
icecast_cfgfile="@l_prefix@/etc/icecast/icecast.xml" |
|
icecast_pidfile="@l_prefix@/var/icecast/icecast.pid" |
|
icecast_signal () { |
|
[ -f $icecast_pidfile ] && kill -$1 `cat $icecast_pidfile` |
|
} |
|
|
|
%status -u @l_nusr@ -o |
|
icecast_usable="unknown" |
|
icecast_active="no" |
|
rcService icecast enable yes && \ |
|
icecast_signal 0 && icecast_active="yes" |
|
echo "icecast_enable=\"$icecast_enable\"" |
|
echo "icecast_usable=\"$icecast_usable\"" |
|
echo "icecast_active=\"$icecast_active\"" |
|
|
|
%start -u @l_nusr@ |
|
rcService icecast enable yes || exit 0 |
|
rcService icecast active yes && exit 0 |
|
@l_prefix@/bin/icecast -b -c $icecast_cfgfile |
|
|
|
%stop -u @l_nusr@ |
|
rcService icecast enable yes || exit 0 |
|
rcService icecast active no && exit 0 |
|
icecast_signal TERM |
|
sleep 2 |
|
rm -f $icecast_pidfile >/dev/null 2>&1 || true |
|
|
|
%restart -u @l_nusr@ |
|
rcService icecast enable yes || exit 0 |
|
rcService icecast active no && exit 0 |
|
rc icecast stop start |
|
|
|
|