diff options
author | Devaev Maxim <[email protected]> | 2019-04-19 18:26:50 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-04-19 18:26:50 +0300 |
commit | 8c285d4c32c2766e99e7c2810d26bd45ac160fa7 (patch) | |
tree | 87633417b91236f316ea05b1b4e6c02fd3732b69 /kvmd.install | |
parent | e941769fdc74b9aaf22f8db09ba71bb0ae634320 (diff) |
post_upgrade()
Diffstat (limited to 'kvmd.install')
-rw-r--r-- | kvmd.install | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/kvmd.install b/kvmd.install index 7b5c9313..7b9db85a 100644 --- a/kvmd.install +++ b/kvmd.install @@ -1,14 +1,22 @@ post_install() { + post_upgrade + + echo "==> Generating KVMD certificate ..." + kvmd-gencert +} + +post_upgrade() { + echo "==> Configuring KVMD user and groups ..." + id kvmd &>/dev/null || useradd -r -c "The main Pi-KVM daemon" -s /sbin/nologin kvmd - groupmems -g gpio -a kvmd - groupmems -g uucp -a kvmd - groupmems -g systemd-journal -a kvmd + + for group in gpio uucp systemd-journal; do + (groupmems -l -g "$group" | grep kvmd >/dev/null) || groupmems -g "$group" -a kvmd + done chown root:kvmd \ /usr/share/kvmd/configs.default/kvmd/htpasswd \ /etc/kvmd/htpasswd - - kvmd-gencert } post_remove() { |