]> git.proxmox.com Git - proxmox-backup.git/blame - debian/postinst
postinst: add user backup to group tape
[proxmox-backup.git] / debian / postinst
CommitLineData
b28253d6
DM
1#!/bin/sh
2
3set -e
4
5#DEBHELPER#
6
7case "$1" in
8 configure)
a57ce270
DM
9 # need to have user backup in the tapoe group
10 usermod -a -G tape backup
11
b28253d6
DM
12 # modeled after dh_systemd_start output
13 systemctl --system daemon-reload >/dev/null || true
b28253d6
DM
14 if [ -n "$2" ]; then
15 _dh_action=try-reload-or-restart
16 else
17 _dh_action=start
18 fi
d7992679 19 deb-systemd-invoke $_dh_action proxmox-backup.service proxmox-backup-proxy.service >/dev/null || true
aafe8609 20
83b039af
TL
21 # FIXME: Remove with 1.1
22 if test -n "$2"; then
23 if dpkg --compare-versions "$2" 'lt' '0.9.4-1'; then
603a6bd1 24 if grep -s -q -P -e '^\s+verify-schedule ' /etc/proxmox-backup/datastore.cfg; then
83b039af
TL
25 echo "NOTE: drop all verify schedules from datastore config."
26 echo "You can now add more flexible verify jobs"
27 flock -w 30 /etc/proxmox-backup/.datastore.lck \
28 sed -i '/^\s\+verify-schedule /d' /etc/proxmox-backup/datastore.cfg || true
29 fi
30 fi
4fdf13f9
TL
31 if dpkg --compare-versions "$2" 'le' '0.9.5-1'; then
32 chown --quiet backup:backup /var/log/proxmox-backup/api/auth.log || true
33 fi
ff7a2910 34 if dpkg --compare-versions "$2" 'le' '0.9.7-1'; then
10052ea6
FG
35 if [ -e /etc/proxmox-backup/remote.cfg ]; then
36 echo "NOTE: Switching over remote.cfg to new field names.."
37 flock -w 30 /etc/proxmox-backup/.remote.lck \
38 sed -i \
39 -e 's/^\s\+userid /\tauth-id /g' \
40 /etc/proxmox-backup/remote.cfg || true
41 fi
42 fi
83b039af 43 fi
ab661513
SR
44 # FIXME: Remove in future version once we're sure no broken entries remain in anyone's files
45 if grep -q -e ':termproxy::[^@]\+: ' /var/log/proxmox-backup/tasks/active; then
46 echo "Fixing up termproxy user id in task log..."
83b039af 47 flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::\([^@]\+\): /:termproxy::\1@pam: /' /var/log/proxmox-backup/tasks/active || true
aafe8609 48 fi
b28253d6
DM
49 ;;
50
51 abort-upgrade|abort-remove|abort-deconfigure)
52 ;;
53
54 *)
55 echo "postinst called with unknown argument \`$1'" >&2
56 exit 1
57 ;;
58esac
59
60exit 0