diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-08-27 04:38:36 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2003-08-27 04:38:36 +0000 |
commit | 63e4cb6f8d13dcd7bf3e9f9acd4bbd7f61fd6f68 (patch) | |
tree | bc21349cb751591f44719305f07527f0dea0d3ab /security/cyrus-sasl/files | |
parent | * Fix bug with already-installed check on older versions of FreeBSD [1] (diff) |
Add RC_SUBR support.
PR: 54116
Submitted by: Scot W. Hetzel <hetzels@westbend.net>
Notes
Notes:
svn path=/head/; revision=87764
Diffstat (limited to 'security/cyrus-sasl/files')
-rw-r--r-- | security/cyrus-sasl/files/pwcheck.sh | 58 | ||||
-rw-r--r-- | security/cyrus-sasl/files/saslauthd.sh | 74 |
2 files changed, 14 insertions, 118 deletions
diff --git a/security/cyrus-sasl/files/pwcheck.sh b/security/cyrus-sasl/files/pwcheck.sh index 7dbfde8711d7..8504b02e3016 100644 --- a/security/cyrus-sasl/files/pwcheck.sh +++ b/security/cyrus-sasl/files/pwcheck.sh @@ -25,56 +25,12 @@ cyrus_pwcheck_enable="%%ENABLE_PWCHECK%%" # Enable pwcheck daemon cyrus_pwcheck_program="${prefix}/sbin/%%PWCHECK%%" # pwcheck program to use # (pwcheck/pwcheck_pam) -if [ -f /etc/rc.subr ]; then - . /etc/rc.subr +. %%RC_SUBR%% - name="cyrus_pwcheck" - rcvar=`set_rcvar` - command=${prefix}/sbin/%%PWCHECK%% - pidfile="/var/run/pwcheck.pid" +name="cyrus_pwcheck" +rcvar=`set_rcvar` +command=${prefix}/sbin/%%PWCHECK%% +pidfile="/var/run/pwcheck.pid" - load_rc_config $name - run_rc_command "$1" -else - # Suck in the configuration variables. - if [ -z "${source_rc_confs_defined}" ]; then - if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs - elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf - fi - fi - - rc=0 - - case "${cyrus_pwcheck_enable}" in - [Yy][Ee][Ss]) - case "${1}" in - - start) - if [ -x ${cyrus_pwcheck_program} ] ; then - ${cyrus_pwcheck_program} && echo -n " cyrus_pwcheck" - fi - ;; - - stop) - if [ -r /var/run/pwcheck.pid ]; then - kill `cat /var/run/pwcheck.pid` && echo -n " cyrus_pwcheck" - rm /var/run/pwcheck.pid - fi - ;; - - *) - echo "usage: $0 {start|stop}" 1>&2 - rc=64 - ;; - esac - ;; - *) - rc=0 - ;; - esac - - exit $rc -fi +load_rc_config $name +run_rc_command "$1" diff --git a/security/cyrus-sasl/files/saslauthd.sh b/security/cyrus-sasl/files/saslauthd.sh index 966179116d16..a07e4a8c7c0d 100644 --- a/security/cyrus-sasl/files/saslauthd.sh +++ b/security/cyrus-sasl/files/saslauthd.sh @@ -25,72 +25,12 @@ saslauthd1_enable="%%ENABLE_SASLAUTHD%%" # Enable saslauthd #saslauthd1_program="${prefix}/sbin/saslauthd1" # Location of saslauthd1 saslauthd1_flags="-a pam" # Flags to saslauthd program -if [ -f /etc/rc.subr ]; then - . /etc/rc.subr +. %%RC_SUBR%% - name="saslauthd1" - rcvar=`set_rcvar` - command="${prefix}/sbin/${name}" - pidfile="/var/state/${name}/mux.pid" +name="saslauthd1" +rcvar=`set_rcvar` +command="${prefix}/sbin/${name}" +pidfile="/var/state/${name}/mux.pid" - load_rc_config $name - run_rc_command "$1" -else - # Suck in the configuration variables. - if [ -z "${source_rc_confs_defined}" ]; then - if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs - elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf - fi - fi - - if [ -n "${sasl_saslauthd1_enable}" ]; then - echo "sasl_saslauthd1_enable has been depreciated, use saslauthd1_enable instead" - saslauthd1_enable=$sasl_saslauthd1_enable - fi - - if [ -z "${saslauthd1_program}" ]; then - saslauthd1_program=${prefix}/sbin/saslauthd1 - fi - - if [ -n "${sasl_saslauthd1_flags}" ]; then - echo "sasl_saslauthd1_flags has been depreciated, use saslauthd1_flags instead" - saslauthd1_flags=$sasl_saslauthd1_flags - fi - - rc=0 - - case "${saslauthd1_enable}" in - [Yy][Ee][Ss]) - case "${1}" in - - start) - if [ -x ${saslauthd1_program} ] ; then - ${saslauthd1_program} ${saslauthd1_flags} \ - && echo -n " saslauthd1" - fi - ;; - - stop) - if [ -r /var/state/saslauthd1/mux.pid ]; then - kill `cat /var/state/saslauthd1/mux.pid` && \ - echo -n " saslauthd1" - rm /var/state/saslauthd1/mux.pid - fi - ;; - - *) - echo "usage: $0 {start|stop}" 1>&2 - rc=64 - ;; - esac - ;; - *) - rc=0 - ;; - esac - - exit $rc -fi +load_rc_config $name +run_rc_command "$1" |