Skip to content

Commit 18b56c0

Browse files
committed
Restart on reinstall
1 parent 472c94b commit 18b56c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

DEBIAN/postinst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash -ex
1+
#! /bin/bash -e
22
echo "Running sg-control postinst in $(pwd)"
33
SG=/opt/sensorgnome # would be nice to derive that from some env var...
44

@@ -29,4 +29,11 @@ for U in sg-control; do
2929
deb-systemd-helper update-state $U >/dev/null || true
3030
fi
3131
fi
32+
33+
# Restart service, if it is running
34+
systemctl daemon-reload
35+
if systemctl is-active --quiet $U.service; then
36+
echo "Restarting $U.service"
37+
systemctl restart $U.service
38+
fi
3239
done

0 commit comments

Comments
 (0)