From a896a9b92a730ad701a514f87820743bbf7bd97b Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 21 Nov 2001 16:29:13 +0000 Subject: Modify script so that it's easier to copy-and-paste when creating similar scripts for other packages. --- sysutils/ups-nut/files/ups.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'sysutils/ups-nut') diff --git a/sysutils/ups-nut/files/ups.sh b/sysutils/ups-nut/files/ups.sh index f1dfc03b5e6..9fa9072931e 100644 --- a/sysutils/ups-nut/files/ups.sh +++ b/sysutils/ups-nut/files/ups.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: ups.sh,v 1.2 2001/11/21 16:05:40 jlam Exp $ +# $NetBSD: ups.sh,v 1.3 2001/11/21 16:29:13 jlam Exp $ # # PROVIDE: ups # KEYWORD: nostart @@ -12,37 +12,37 @@ fi # NOTE: run_rc_command sets $_arg # -ups_commands() +forward_commands() { - for file in $UPS_COMMANDS; do + for file in $COMMAND_LIST; do /etc/rc.d/$file $_arg done } -ups_reversecommands() +reverse_commands() { - UPS_REVCOMMANDS= - for file in $UPS_COMMANDS; do - UPS_REVCOMMANDS="$file $UPS_REVCOMMANDS" + REVCOMMAND_LIST= + for file in $COMMAND_LIST; do + REVCOMMAND_LIST="$file $REVCOMMAND_LIST" done - for file in $UPS_REVCOMMANDS; do + for file in $REVCOMMAND_LIST; do /etc/rc.d/$file $_arg done } -UPS_COMMANDS="upsdriver upsd upsmon upslog" +COMMAND_LIST="upsdriver upsd upsmon upslog" name="ups" -start_cmd="ups_commands" -stop_cmd="ups_reversecommands" -status_cmd="ups_commands" +start_cmd="forward_commands" +stop_cmd="reverse_commands" +status_cmd="forward_commands" extra_commands="status" if [ ! -d /etc/rc.d ] then @ECHO@ -n " ${name}" _arg="$1" - ${start_cmd} "$1" + ${start_cmd} else run_rc_command "$1" fi -- cgit v1.2.3