File: glewlwyd.postrm

package info (click to toggle)
glewlwyd 1.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 16,096 kB
  • sloc: ansic: 14,286; sql: 1,499; sh: 246; makefile: 150
file content (58 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
set -e

. /usr/share/debconf/confmodule

if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
  . /usr/share/dbconfig-common/dpkg/postrm
  dbc_go glewlwyd "$@"
fi

if [ "$1" = "remove" ]; then
  if [ -x "/usr/bin/deb-systemd-helper" ]; then
    deb-systemd-helper mask glewlwyd.service >/dev/null
  fi
fi

if [ "$1" = "purge" ]; then
  if [ -d "/etc/glewlwyd/" ]; then
    rm -f /etc/glewlwyd/glewlwyd.conf || true
    rm -f /etc/glewlwyd/glewlwyd-db.conf || true
    rm -f /etc/glewlwyd/private-rsa.key || true
    rm -f /etc/glewlwyd/public-rsa.pem || true
    rm -f /etc/glewlwyd/private-ecdsa.key || true
    rm -f /etc/glewlwyd/public-ecdsa.pem || true
    rmdir /etc/glewlwyd/ || true
  fi
  
  if [ -f "/etc/dbconfig-common/glewlwyd.conf" ]; then
    rm -f /etc/dbconfig-common/glewlwyd.conf || true
  fi
  
  if [ -f "/var/log/glewlwyd.log" ]; then
    rm -f /var/log/glewlwyd.log || true
  fi
  
  if [ -f "/var/lib/dbconfig-common/sqlite3/glewlwyd/glewlwyd" ]; then
    rm -f /var/lib/dbconfig-common/sqlite3/glewlwyd/glewlwyd || true
  fi
  
  if [ -d "/var/lib/dbconfig-common/sqlite3/glewlwyd/" ]; then
    rmdir /var/lib/dbconfig-common/sqlite3/glewlwyd/ || true
  fi
  
  if [ -x "$(command -v deluser)" ]; then
     deluser --quiet --system glewlwyd > /dev/null || true
  else
     echo >&2 "not removing glewlwyd system account because deluser command was not found"
  fi
  
  db_purge

  if which ucf >/dev/null 2>&1; then
    ucf --purge /etc/glewlwyd/glewlwyd-db.conf
    ucfr --purge glewlwyd /etc/glewlwyd/glewlwyd-db.conf
  fi
fi

#DEBHELPER#