File: nginx.postinst

package info (click to toggle)
nginx 1.28.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,508 kB
  • sloc: ansic: 169,561; sh: 623; perl: 439; python: 240; makefile: 130; cpp: 19
file content (32 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
set -e

case "$1" in
  abort-upgrade|abort-remove|abort-deconfigure|configure)
    ;;
  triggered)
    if invoke-rc.d --quiet nginx status >/dev/null; then
      echo "Triggering nginx reload ..."
      invoke-rc.d nginx reload || true
    fi
    exit 0
    ;;
  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
    ;;
esac

if invoke-rc.d --quiet nginx status >/dev/null; then
  invoke-rc.d nginx upgrade || invoke-rc.d nginx restart
  exit $?
else
  if ! invoke-rc.d nginx start; then
    echo "Failed to start NGINX in postinst script, please check the logs" >&2
    exit 0
  fi
fi

#DEBHELPER#

exit 0