Skip to content

Commit

Permalink
scripts/upsdrvsvcctl/upsdrvsvcctl.in: allow caller to customize ENUME…
Browse files Browse the repository at this point in the history
…RATOR and UPSDRVCTL when testing [networkupstools#2567]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Aug 1, 2024
1 parent 8acb12d commit 30cec0d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/upsdrvsvcctl/upsdrvsvcctl.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@ CMDARG=""
# Note: some frameworks separate the commands for acting and for reporting
CMDREPORT=""
CMDREPORTARG=""
ENUMERATOR=""
case "$SERVICE_FRAMEWORK" in
smf) CMD="/usr/sbin/svcadm"
CMDREPORT="/usr/bin/svcs"
ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
[ -n "${ENUMERATOR-}" ] && export ENUMERATOR || ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
;;
systemd) CMD="/bin/systemctl"
CMDREPORT="${CMD}"
ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
[ -n "${ENUMERATOR-}" ] && export ENUMERATOR || ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
;;
*) echo "Unrecognized SERVICE_FRAMEWORK: $SERVICE_FRAMEWORK" >&2 ; exit ;;
esac
UPSDRVCTL='@SBINDIR@/upsdrvctl'
[ -n "${UPSDRVCTL-}" ] && export UPSDRVCTL || UPSDRVCTL='@SBINDIR@/upsdrvctl'
PACKAGE_VERSION='@PACKAGE_VERSION@'

usage() {
Expand Down

0 comments on commit 30cec0d

Please sign in to comment.