Debian Codegraph @

debian/postinst

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 set -e
4
5 . /usr/share/debconf/confmodulescip-shell source . . `/usr/share/debconf/confmodule`.
6
7 config="/etc/prometheus-nextcloud-exporter.ymlscip-shell filesystem . . `/etc/prometheus-nextcloud-exporter.yml`."
8
9 update_configscip-shell shell shell-project 0.0.0 update_config(). () {
10 db_get prometheus-nextcloud-exporter/server
11 server="$RET"
12 db_get prometheus-nextcloud-exporter/username
13 username="$RET"
14 db_get prometheus-nextcloud-exporter/password
15 password="$RET"
16
17 sedscip-shell system . . sed. -i -e "s|^\(\s*server:\s*\"\)\S\+\(\"\s*\)$|\1$server\2|" \
18 -e "s|^\(\s*username:\s*\"\)\S\+\(\"\s*\)$|\1$username\2|" \
19 -e "s|^\(\s*password:\s*\"\)\S\+\(\"\s*\)$|\1$password\2|" \
20 "$config"
21 }
22
23 case "$1" in
24 configure)
25 # Add prometheus user
26 adduserscip-shell system . . adduser. --quiet --system --home /var/lib/prometheusscip-shell filesystem . . `/var/lib/prometheus`. --no-create-home \
27 --group --gecos "Prometheus daemon" prometheus
28
29 [scip-shell system . . `[`. -f "$config" ] && update_configscip-shell shell shell-project 0.0.0 update_config().
30 if ! dpkg-statoverridescip-shell system . . dpkg-statoverride. --list /etc/prometheus-nextcloud-exporter.ymlscip-shell filesystem . . `/etc/prometheus-nextcloud-exporter.yml`. \
31 >/dev/nullscip-shell filesystem . . `/dev/null`.
32 then
33 chownscip-shell system . . chown. root:prometheus /etc/prometheus-nextcloud-exporter.ymlscip-shell filesystem . . `/etc/prometheus-nextcloud-exporter.yml`.
34 chmodscip-shell system . . chmod. 640 /etc/prometheus-nextcloud-exporter.ymlscip-shell filesystem . . `/etc/prometheus-nextcloud-exporter.yml`.
35 fi
36 ;;
37
38 abort-upgrade|abort-remove|abort-deconfigure)
39 ;;
40
41 *)
42 echoscip-shell system . . echo. "postinst called with unknown argument \`$1'" >&2
43 exit 1
44 ;;
45 esac
46
47 #DEBHELPER#
48
49 exit 0