Date: Thu, 19 Jan 2012 06:13:59 -0500 (EST) From: Michael Scheidell <scheidell@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: dougb@FreeBSD.org Subject: ports/164307: [PATCH] update rc file for audio/shoutcast Message-ID: <20120119111359.D57C11D3E2@scanner.secnap.net> Resent-Message-ID: <201201191120.q0JBKBga088962@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 164307 >Category: ports >Synopsis: [PATCH] update rc file for audio/shoutcast >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 19 11:20:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Michael Scheidell >Release: >Organization: SECNAP Network Security >Environment: all of them >Description: - Clean up of rc script. submitted via email by dougb@FreeBSD.org >How-To-Repeat: >Fix: Attached patch --- shoutcast.txt begins here --- Index: files/shoutcast.in =================================================================== RCS file: /home/pcvs/ports/audio/shoutcast/files/shoutcast.in,v retrieving revision 1.1 diff -u -r1.1 shoutcast.in --- files/shoutcast.in 19 Jan 2012 01:23:55 -0000 1.1 +++ files/shoutcast.in 19 Jan 2012 11:09:44 -0000 @@ -1,45 +1,44 @@ #!/bin/sh -# + # $FreeBSD: ports/audio/shoutcast/files/shoutcast.in,v 1.1 2012/01/19 01:23:55 scheidell Exp $ # - # PROVIDE: shoutcast # REQUIRE: LOGIN -# BEFORE: # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable SHOUTcast: # shoutcast_enable (bool): Set to "NO" by default. # Set it to "YES" to enable SHOUTcast. # shoutcast_configfile (str): Set to "%%PREFIX%%/%%ETCDIR%%/sc_serv.conf" by default. -# +# shoutcast_user (str): Set to %%SHOUTCASTUSER%% by default +# shoutcast_chdir (str): Set to %%SHOUTCASTDIR%% by default . /etc/rc.subr -name="shoutcast" -rcvar=`set_rcvar` -shoutcast_logfile="/var/log/sc_serv.log" +name=shoutcast +rcvar=shoutcast_enable -start_cmd="shoutcast_startcmd" -stop_cmd="shoutcast_stopcmd" +load_rc_config shoutcast -[ -z "${shoutcast_enable}" ] && shoutcast_enable="NO" -[ -z "${shoutcast_configfile}" ] && shoutcast_configfile="%%PREFIX%%/%%ETCDIR%%/sc_serv.conf" +: ${shoutcast_enable:="NO"} +: ${shoutcast_user:="%%SHOUTCASTUSER%%"} +: ${shoutcast_chdir:="%%SHOUTCASTDIR%%"} -load_rc_config "${name}" +command="%%PREFIX%%/sbin/sc_serv" +shoutcast_logfile="/var/log/sc_serv.log" + +required_dirs="${shoutcast_chdir}" +required_files="${shoutcast_configfile:="%%PREFIX%%/%%ETCDIR%%/sc_serv.conf"}" + +command_args="${required_files} >/dev/null 2>&1 &" -required_files="${shoutcast_configfile}" +start_precmd="shoutcast_prestart" -shoutcast_startcmd() { +shoutcast_prestart() +{ touch ${shoutcast_logfile} chown %%SHOUTCASTUSER%%:wheel ${shoutcast_logfile} chmod 0640 ${shoutcast_logfile} - su %%SHOUTCASTUSER%% -c "cd %%SHOUTCASTDIR%% && %%PREFIX%%/sbin/sc_serv ${shoutcast_configfile} >/dev/null 2>&1 &" -} - -shoutcast_stopcmd() { - killall sc_serv } run_rc_command "$1" --- shoutcast.txt ends here --- ______________________________________________________________________ This email has been scanned and certified safe by SpammerTrap(r). For Information please see http://www.spammertrap.com/ ______________________________________________________________________ >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120119111359.D57C11D3E2>