Debian Codegraph @

nrpe/packaging/scripts/centreon-nrpe4-daemon-postinstall.sh

raw
1 #!/bin/sh
2
3 startNrpeDaemon() {
4 systemctl daemon-reload ||:
5 systemctl unmask centreon-nrpe4.service ||:
6 systemctl preset centreon-nrpe4.service ||:
7 systemctl enable centreon-nrpe4.service ||:
8 systemctl restart centreon-nrpe4.service ||:
9 }
10
11 action="$1"
12 if [ "$1" = "configure" ] && [ -z "$2" ]; then
13 # Alpine linux does not pass args, and deb passes $1=configure
14 action="install"
15 elif [ "$1" = "configure" ] && [ -n "$2" ]; then
16 # deb passes $1=configure $2=<current version>
17 action="upgrade"
18 fi
19
20 case "$action" in
21 "1" | "install")
22 startNrpeDaemon
23 ;;
24 "2" | "upgrade")
25 startNrpeDaemon
26 ;;
27 *)
28 # $1 == version being installed
29 startNrpeDaemon
30 ;;
31 esac