mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
Update Icinga2Agent.bash
Modified the script template for compatibility with alpine linux
This commit is contained in:
parent
18f9e729e4
commit
c12f5876ad
@ -81,6 +81,13 @@ elif check_command dpkg; then
|
||||
. /etc/default/icinga2
|
||||
fi
|
||||
ICINGA2_OSFAMILY=debian
|
||||
elif check_command apk; then
|
||||
info "This should be a Alpine system"
|
||||
if [ -e /etc/icinga2/icinga2.sysconfig ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /etc/icinga2/icinga2.sysconfig
|
||||
fi
|
||||
ICINGA2_OSFAMILY=alpine
|
||||
else
|
||||
fail "Could not determine your os type!"
|
||||
fi
|
||||
@ -103,6 +110,10 @@ redhat)
|
||||
: "${ICINGA2_USER:=icinga}"
|
||||
: "${ICINGA2_GROUP:=icinga}"
|
||||
;;
|
||||
alpine)
|
||||
: "${ICINGA2_USER:=icinga}"
|
||||
: "${ICINGA2_GROUP:=icinga}"
|
||||
;;
|
||||
*)
|
||||
fail "Unknown osfamily '$ICINGA2_OSFAMILY'!"
|
||||
;;
|
||||
@ -275,7 +286,20 @@ if [ -z "${ICINGA2_DRYRUN}" ]; then
|
||||
"$ICINGA2_BIN" daemon -C
|
||||
|
||||
echo "Please restart icinga2:"
|
||||
echo " systemctl restart icinga2"
|
||||
case "$ICINGA2_OSFAMILY" in
|
||||
debian)
|
||||
echo " systemctl restart icinga2"
|
||||
;;
|
||||
redhat)
|
||||
echo " systemctl restart icinga2"
|
||||
;;
|
||||
alpine)
|
||||
echo " rc-service icinga2 restart"
|
||||
;;
|
||||
*)
|
||||
fail "Unknown osfamily '$ICINGA2_OSFAMILY'!"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
output_code() {
|
||||
sed 's/^/ /m' <<<"$1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user