File: twoftpd-run.postrm

package info (click to toggle)
twoftpd 1.42-1.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 700 kB
  • sloc: sh: 2,929; ansic: 2,182; makefile: 93
file content (27 lines) | stat: -rw-r--r-- 748 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
#!/bin/sh
set -e

test "$1" = 'purge' || exit 0

sv force-stop /etc/twoftpd /etc/twoftpd-anon >/dev/null 2>&1 || :
sv force-stop /etc/twoftpd/log /etc/twoftpd-anon/log >/dev/null 2>&1 || :

for i in twoftpd twoftpd-anon; do
  rm -rf /etc/$i/supervise /etc/$i/log/supervise 2>/dev/null
  rm -rf /var/lib/supervise/$i /var/lib/supervise/$i.log 2>/dev/null
done

for i in twoftpd twoftpd-anon; do
  for j in '@*' current config lock state; do
    rm -f /var/log/$i/$j
  done
  rmdir /var/log/$i || :
done

getent passwd ftp >/dev/null || getent passwd ftplog >/dev/null || exit 0
if ! deluser --version >/dev/null 2>&1; then
  echo 'deluser program not available, not removing system users "ftp", "ftplog".' >&2
  exit 0
fi
deluser ftp
deluser ftplog