-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg.install
More file actions
24 lines (20 loc) · 842 Bytes
/
pkg.install
File metadata and controls
24 lines (20 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
post_install() {
post_upgrade
}
post_upgrade() {
echo "==> Ensuring KVMD-Cloud users and groups ..."
systemd-sysusers /usr/lib/sysusers.d/kvmd-cloud.conf
# https://github.com/systemd/systemd/issues/13522
# shellcheck disable=SC2013
for user in $(grep '^u ' /usr/lib/sysusers.d/kvmd-cloud.conf | awk '{print $2}'); do
usermod --expiredate= "$user" >/dev/null
done
chown root:root /etc/kvmd/cloud/ssl 2>/dev/null || true
chown root:kvmd-nginx /etc/kvmd/cloud/ssl/* 2>/dev/null || true
chmod 440 /etc/kvmd/cloud/ssl/server.key 2>/dev/null || true
chmod 444 /etc/kvmd/cloud/ssl/server.crt 2>/dev/null || true
if [ -f /etc/kvmd/cloud/nginx.ctx-http.conf ]; then
sed -i -e 's|include /etc/kvmd/nginx/redirect-to-https.conf;|location / { return 301 https://$host$request_uri; }|g' \
/etc/kvmd/cloud/nginx.ctx-http.conf
fi
}