File: postremove.sh

package info (click to toggle)
openvpn-auth-oauth2 1.27.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,212 kB
  • sloc: ansic: 172; makefile: 72; sh: 53; javascript: 10
file content (23 lines) | stat: -rwxr-xr-x 677 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
#!/bin/sh

set -e

case $1 in
1 | upgrade | failed-upgrade)
  # RPM: If the first argument is 1, it means the package is being upgraded. https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
  # DEB: If the first argument is upgrade or failed-upgrade, it means the package is being upgraded. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#summary-of-ways-maintainer-scripts-are-called
  ;;

*)
  if id -g openvpn-auth-oauth2 >/dev/null 2>&1; then
    groupdel openvpn-auth-oauth2 >/dev/null || true
  fi

  if ! command -v systemctl >/dev/null 2>&1; then
    exit 0
  fi

  systemctl daemon-reload
  systemctl reset-failed
  ;;
esac