new upstream 2.8.0
This commit is contained in:
parent
fc7f4b43c1
commit
b2b0c9995a
836 changed files with 137090 additions and 30018 deletions
13
scripts/upsdrvsvcctl/Makefile.am
Normal file
13
scripts/upsdrvsvcctl/Makefile.am
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
EXTRA_DIST = README
|
||||
|
||||
if HAVE_SYSTEMD
|
||||
EXTRA_DIST += nut-driver-enumerator.sh upsdrvsvcctl
|
||||
else
|
||||
if WITH_SOLARIS_SMF
|
||||
EXTRA_DIST += nut-driver-enumerator.sh upsdrvsvcctl
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST += nut-driver-enumerator.sh.in upsdrvsvcctl.in
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
574
scripts/upsdrvsvcctl/Makefile.in
Normal file
574
scripts/upsdrvsvcctl/Makefile.in
Normal file
|
|
@ -0,0 +1,574 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@HAVE_SYSTEMD_TRUE@am__append_1 = nut-driver-enumerator.sh upsdrvsvcctl
|
||||
@HAVE_SYSTEMD_FALSE@@WITH_SOLARIS_SMF_TRUE@am__append_2 = nut-driver-enumerator.sh upsdrvsvcctl
|
||||
subdir = scripts/upsdrvsvcctl
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = nut-driver-enumerator.sh upsdrvsvcctl
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(srcdir)/nut-driver-enumerator.sh.in \
|
||||
$(srcdir)/upsdrvsvcctl.in README
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BINDIR = @BINDIR@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_NAME = @OS_NAME@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PIDPATH = @PIDPATH@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SBINDIR = @SBINDIR@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
hotplugdir = @hotplugdir@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
now = @now@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
EXTRA_DIST = README $(am__append_1) $(am__append_2) \
|
||||
nut-driver-enumerator.sh.in upsdrvsvcctl.in
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/upsdrvsvcctl/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu scripts/upsdrvsvcctl/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
nut-driver-enumerator.sh: $(top_builddir)/config.status $(srcdir)/nut-driver-enumerator.sh.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
upsdrvsvcctl: $(top_builddir)/config.status $(srcdir)/upsdrvsvcctl.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags-am uninstall uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
11
scripts/upsdrvsvcctl/README
Normal file
11
scripts/upsdrvsvcctl/README
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
This directory contains the shared NUT support files for Linux systemd (the
|
||||
System and Service Manager) and Solaris SMF (Service Management Framework).
|
||||
It includes the nut-driver-enumerator.sh (service and implementation method)
|
||||
and upsdrvsvcctl (tool) to manage NUT drivers as service instances.
|
||||
|
||||
These files are automatically installed into SBINDIR/upsdrvsvcctl and
|
||||
LIBEXECDIR/nut-driver-enumerator.sh, upon detection (at configure time)
|
||||
of a systemd or SMF enabled system, with Makefiles of the ../systemd/ and
|
||||
../Solaris/ source directories respectively.
|
||||
|
||||
Contributed 2016-2018 by Jim Klimov <EvgenyKlimov@eaton.com>
|
||||
1391
scripts/upsdrvsvcctl/nut-driver-enumerator.sh
Executable file
1391
scripts/upsdrvsvcctl/nut-driver-enumerator.sh
Executable file
File diff suppressed because it is too large
Load diff
1391
scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in
Executable file
1391
scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in
Executable file
File diff suppressed because it is too large
Load diff
196
scripts/upsdrvsvcctl/upsdrvsvcctl
Executable file
196
scripts/upsdrvsvcctl/upsdrvsvcctl
Executable file
|
|
@ -0,0 +1,196 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2016-2018 Eaton
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#! \file upsdrvsvcctl(.in)
|
||||
# \author Jim Klimov <EvgenyKlimov@eaton.com>
|
||||
# \brief Manage NUT devices registered as service-unit instances
|
||||
#
|
||||
|
||||
if [ -z "${SERVICE_FRAMEWORK-}" ] ; then
|
||||
[ -x /usr/sbin/svcadm ] && [ -x /usr/sbin/svccfg ] && [ -x /usr/bin/svcs ] && \
|
||||
SERVICE_FRAMEWORK="smf"
|
||||
[ -z "${SERVICE_FRAMEWORK-}" ] && \
|
||||
[ -x /bin/systemctl ] && \
|
||||
SERVICE_FRAMEWORK="systemd"
|
||||
fi
|
||||
|
||||
VERB=""
|
||||
CMD=""
|
||||
CMDARG=""
|
||||
ENUMERATOR=""
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMD="/usr/sbin/svcadm"
|
||||
ENUMERATOR="/usr/local/libexec/nut-driver-enumerator.sh"
|
||||
;;
|
||||
systemd) CMD="/bin/systemctl"
|
||||
ENUMERATOR="/usr/local/libexec/nut-driver-enumerator.sh"
|
||||
;;
|
||||
*) echo "Unrecognized SERVICE_FRAMEWORK: $SERVICE_FRAMEWORK" >&2 ; exit ;;
|
||||
esac
|
||||
|
||||
|
||||
usage() {
|
||||
# Note: version header differs from UPS_VERSION in binaries that
|
||||
# might also have the git-version suffixed during build time
|
||||
cat << EOF
|
||||
Network UPS Tools - UPS driver controller ${PACKAGE_VERSION}
|
||||
Starts and stops UPS drivers via system service instances, see
|
||||
the $ENUMERATOR
|
||||
script for more details.
|
||||
|
||||
usage: $0 [OPTIONS] (start | stop | shutdown) [<ups>]
|
||||
|
||||
Options:
|
||||
-h display this help
|
||||
-t testing mode - prints actions without doing them
|
||||
-D raise debugging level
|
||||
start start all UPS drivers in ups.conf
|
||||
start <ups> only start driver for UPS <ups>
|
||||
stop stop all UPS drivers in ups.conf
|
||||
stop <ups> only stop driver for UPS <ups>
|
||||
|
||||
Note: the "shutdown" options from original upsdrvctl are not currently
|
||||
directly supported by this service management framework wrapper; instead
|
||||
they are passed to the native upsdrvctl binary (your current user account
|
||||
should have sufficient permissions to do that all):
|
||||
shutdown shutdown all UPS drivers in ups.conf
|
||||
shutdown <ups> only shutdown UPS <ups>
|
||||
|
||||
usage: $0 [OPTIONS] resync
|
||||
resync call $ENUMERATOR
|
||||
to update the mapping of service instances for
|
||||
NUT drivers to device sections in 'ups.conf'
|
||||
|
||||
usage: $0 [OPTIONS] reconfigure
|
||||
reconfigure call $ENUMERATOR
|
||||
to remove and re-create the mapping of all service
|
||||
instances for NUT drivers to device sections in
|
||||
'ups.conf' e.g. after a NUT package upgrade
|
||||
|
||||
usage: $0 [OPTIONS] list [<ups>]
|
||||
list call $ENUMERATOR
|
||||
to list the mapping of service instances to device sections
|
||||
list <ups> (optionally return the service instance name for one device)
|
||||
|
||||
usage: $0 [OPTIONS] show-config [<ups>]
|
||||
show-config <ups> output config section from ups.conf for device <ups>
|
||||
show-config ...or all devices if no <ups> argument was passed
|
||||
EOF
|
||||
}
|
||||
|
||||
ACTION=""
|
||||
SVCINST=""
|
||||
DRYRUN=""
|
||||
DEBUG=0
|
||||
# Note: DEBUG is UNUSED_PARAM so far
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
resync) eval $DRYRUN $ENUMERATOR ; exit $? ;;
|
||||
reconf|reconfigure) eval $DRYRUN $ENUMERATOR --reconfigure ; exit $? ;;
|
||||
list)
|
||||
if [ -n "$2" ] ; then
|
||||
eval $ENUMERATOR --get-service-for-device "$2" ; exit $?
|
||||
else
|
||||
eval $ENUMERATOR --list-services-for-devices ; exit $?
|
||||
fi
|
||||
;;
|
||||
show-config)
|
||||
if [ -n "$2" ] ; then
|
||||
eval $ENUMERATOR --show-device-config "$2" ; exit $?
|
||||
else
|
||||
eval $ENUMERATOR --show-all-configs ; exit $?
|
||||
fi
|
||||
;;
|
||||
start|stop)
|
||||
ACTION="$1"
|
||||
if [ -n "$2" ] ; then
|
||||
SVCINST="`$ENUMERATOR --get-service-for-device "$2"`" || exit
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
shutdown)
|
||||
echo "NOTE: Action '$1' is not implemented via services currently, will call upsdrvctl" >&2
|
||||
echo "Stopping the driver service instance(s) to release exclusive resources, if any..." >&2
|
||||
RES=0
|
||||
$0 stop $2
|
||||
/usr/local/sbin/upsdrvctl shutdown $2 || RES=$?
|
||||
echo "Starting the driver service instance(s) so they can reconnect when the UPS returns..." >&2
|
||||
$0 start $2
|
||||
exit $RES
|
||||
;;
|
||||
-t) DRYRUN="echo" ;;
|
||||
-h) usage; exit 0 ;;
|
||||
-D) DEBUG="`expr $DEBUG + 1`" ;;
|
||||
-r|-u) echo "Option '$1 $2' is not implemented via services currently" >&2 ; shift;;
|
||||
*) echo "Unrecognized argument: $1" >&2 ; exit ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$ENUMERATOR" ] || [ ! -s "$ENUMERATOR" ] || [ ! -x "$ENUMERATOR" ] ; then
|
||||
echo "ENUMERATOR script (nut-driver-enumerator.sh) not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$ACTION" ]; then
|
||||
echo "No action was requested!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$SVCINST" ]; then
|
||||
SVCINST="`$ENUMERATOR --list-services`" || exit
|
||||
fi
|
||||
|
||||
# TODO: Support shutdown of one or all UPSes by stopping its service
|
||||
# and then calling the original upsdrvctl on it?
|
||||
case "$ACTION" in
|
||||
start)
|
||||
VERB="Starting"
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMDARG="enable -ts" ;;
|
||||
systemd) CMDARG="start" ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
VERB="Stopping"
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMDARG="disable -ts" ;;
|
||||
systemd) CMDARG="stop" ;;
|
||||
esac
|
||||
;;
|
||||
*) echo "Unrecognized ACTION: $ACTION" >&2 ; exit ;;
|
||||
esac
|
||||
|
||||
for INST in $SVCINST ; do
|
||||
echo "$VERB $INST ..." >&2
|
||||
$DRYRUN $CMD $CMDARG "$INST" &
|
||||
done
|
||||
wait
|
||||
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf)
|
||||
sleep 1
|
||||
echo "Post-process clearing services that failed early..." >&2
|
||||
for INST in $SVCINST ; do
|
||||
echo "Clearing $INST (if it got broken) ..." >&2
|
||||
$DRYRUN $CMD clear "$INST" &
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
wait
|
||||
196
scripts/upsdrvsvcctl/upsdrvsvcctl.in
Executable file
196
scripts/upsdrvsvcctl/upsdrvsvcctl.in
Executable file
|
|
@ -0,0 +1,196 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2016-2018 Eaton
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#! \file upsdrvsvcctl(.in)
|
||||
# \author Jim Klimov <EvgenyKlimov@eaton.com>
|
||||
# \brief Manage NUT devices registered as service-unit instances
|
||||
#
|
||||
|
||||
if [ -z "${SERVICE_FRAMEWORK-}" ] ; then
|
||||
[ -x /usr/sbin/svcadm ] && [ -x /usr/sbin/svccfg ] && [ -x /usr/bin/svcs ] && \
|
||||
SERVICE_FRAMEWORK="smf"
|
||||
[ -z "${SERVICE_FRAMEWORK-}" ] && \
|
||||
[ -x /bin/systemctl ] && \
|
||||
SERVICE_FRAMEWORK="systemd"
|
||||
fi
|
||||
|
||||
VERB=""
|
||||
CMD=""
|
||||
CMDARG=""
|
||||
ENUMERATOR=""
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMD="/usr/sbin/svcadm"
|
||||
ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
|
||||
;;
|
||||
systemd) CMD="/bin/systemctl"
|
||||
ENUMERATOR="@NUT_LIBEXECDIR@/nut-driver-enumerator.sh"
|
||||
;;
|
||||
*) echo "Unrecognized SERVICE_FRAMEWORK: $SERVICE_FRAMEWORK" >&2 ; exit ;;
|
||||
esac
|
||||
|
||||
|
||||
usage() {
|
||||
# Note: version header differs from UPS_VERSION in binaries that
|
||||
# might also have the git-version suffixed during build time
|
||||
cat << EOF
|
||||
Network UPS Tools - UPS driver controller ${PACKAGE_VERSION}
|
||||
Starts and stops UPS drivers via system service instances, see
|
||||
the $ENUMERATOR
|
||||
script for more details.
|
||||
|
||||
usage: $0 [OPTIONS] (start | stop | shutdown) [<ups>]
|
||||
|
||||
Options:
|
||||
-h display this help
|
||||
-t testing mode - prints actions without doing them
|
||||
-D raise debugging level
|
||||
start start all UPS drivers in ups.conf
|
||||
start <ups> only start driver for UPS <ups>
|
||||
stop stop all UPS drivers in ups.conf
|
||||
stop <ups> only stop driver for UPS <ups>
|
||||
|
||||
Note: the "shutdown" options from original upsdrvctl are not currently
|
||||
directly supported by this service management framework wrapper; instead
|
||||
they are passed to the native upsdrvctl binary (your current user account
|
||||
should have sufficient permissions to do that all):
|
||||
shutdown shutdown all UPS drivers in ups.conf
|
||||
shutdown <ups> only shutdown UPS <ups>
|
||||
|
||||
usage: $0 [OPTIONS] resync
|
||||
resync call $ENUMERATOR
|
||||
to update the mapping of service instances for
|
||||
NUT drivers to device sections in 'ups.conf'
|
||||
|
||||
usage: $0 [OPTIONS] reconfigure
|
||||
reconfigure call $ENUMERATOR
|
||||
to remove and re-create the mapping of all service
|
||||
instances for NUT drivers to device sections in
|
||||
'ups.conf' e.g. after a NUT package upgrade
|
||||
|
||||
usage: $0 [OPTIONS] list [<ups>]
|
||||
list call $ENUMERATOR
|
||||
to list the mapping of service instances to device sections
|
||||
list <ups> (optionally return the service instance name for one device)
|
||||
|
||||
usage: $0 [OPTIONS] show-config [<ups>]
|
||||
show-config <ups> output config section from ups.conf for device <ups>
|
||||
show-config ...or all devices if no <ups> argument was passed
|
||||
EOF
|
||||
}
|
||||
|
||||
ACTION=""
|
||||
SVCINST=""
|
||||
DRYRUN=""
|
||||
DEBUG=0
|
||||
# Note: DEBUG is UNUSED_PARAM so far
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
resync) eval $DRYRUN $ENUMERATOR ; exit $? ;;
|
||||
reconf|reconfigure) eval $DRYRUN $ENUMERATOR --reconfigure ; exit $? ;;
|
||||
list)
|
||||
if [ -n "$2" ] ; then
|
||||
eval $ENUMERATOR --get-service-for-device "$2" ; exit $?
|
||||
else
|
||||
eval $ENUMERATOR --list-services-for-devices ; exit $?
|
||||
fi
|
||||
;;
|
||||
show-config)
|
||||
if [ -n "$2" ] ; then
|
||||
eval $ENUMERATOR --show-device-config "$2" ; exit $?
|
||||
else
|
||||
eval $ENUMERATOR --show-all-configs ; exit $?
|
||||
fi
|
||||
;;
|
||||
start|stop)
|
||||
ACTION="$1"
|
||||
if [ -n "$2" ] ; then
|
||||
SVCINST="`$ENUMERATOR --get-service-for-device "$2"`" || exit
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
shutdown)
|
||||
echo "NOTE: Action '$1' is not implemented via services currently, will call upsdrvctl" >&2
|
||||
echo "Stopping the driver service instance(s) to release exclusive resources, if any..." >&2
|
||||
RES=0
|
||||
$0 stop $2
|
||||
@SBINDIR@/upsdrvctl shutdown $2 || RES=$?
|
||||
echo "Starting the driver service instance(s) so they can reconnect when the UPS returns..." >&2
|
||||
$0 start $2
|
||||
exit $RES
|
||||
;;
|
||||
-t) DRYRUN="echo" ;;
|
||||
-h) usage; exit 0 ;;
|
||||
-D) DEBUG="`expr $DEBUG + 1`" ;;
|
||||
-r|-u) echo "Option '$1 $2' is not implemented via services currently" >&2 ; shift;;
|
||||
*) echo "Unrecognized argument: $1" >&2 ; exit ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$ENUMERATOR" ] || [ ! -s "$ENUMERATOR" ] || [ ! -x "$ENUMERATOR" ] ; then
|
||||
echo "ENUMERATOR script (nut-driver-enumerator.sh) not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$ACTION" ]; then
|
||||
echo "No action was requested!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$SVCINST" ]; then
|
||||
SVCINST="`$ENUMERATOR --list-services`" || exit
|
||||
fi
|
||||
|
||||
# TODO: Support shutdown of one or all UPSes by stopping its service
|
||||
# and then calling the original upsdrvctl on it?
|
||||
case "$ACTION" in
|
||||
start)
|
||||
VERB="Starting"
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMDARG="enable -ts" ;;
|
||||
systemd) CMDARG="start" ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
VERB="Stopping"
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf) CMDARG="disable -ts" ;;
|
||||
systemd) CMDARG="stop" ;;
|
||||
esac
|
||||
;;
|
||||
*) echo "Unrecognized ACTION: $ACTION" >&2 ; exit ;;
|
||||
esac
|
||||
|
||||
for INST in $SVCINST ; do
|
||||
echo "$VERB $INST ..." >&2
|
||||
$DRYRUN $CMD $CMDARG "$INST" &
|
||||
done
|
||||
wait
|
||||
|
||||
case "$SERVICE_FRAMEWORK" in
|
||||
smf)
|
||||
sleep 1
|
||||
echo "Post-process clearing services that failed early..." >&2
|
||||
for INST in $SVCINST ; do
|
||||
echo "Clearing $INST (if it got broken) ..." >&2
|
||||
$DRYRUN $CMD clear "$INST" &
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
wait
|
||||
Loading…
Add table
Add a link
Reference in a new issue