aboutsummaryrefslogtreecommitdiffhomepage
path: root/debian/rustdesk-server-hbbr.postinst
blob: df753328c161dbd06728b276f6005b5ab936e577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -e

SERVICE=rustdesk-hbbr.service

if [ "$1" = "configure" ]; then
    mkdir -p /var/log/rustdesk-server
fi

case "$1" in
    configure|abort-upgrade|abort-deconfigure|abort-remove)
      mkdir -p /var/lib/rustdesk-server/
	  deb-systemd-helper unmask "${SERVICE}" >/dev/null || true
	  if deb-systemd-helper --quiet was-enabled "${SERVICE}"; then
	  	deb-systemd-invoke enable "${SERVICE}" >/dev/null || true
	  else
	  	deb-systemd-invoke update-state "${SERVICE}" >/dev/null || true
	  fi
	  systemctl --system daemon-reload >/dev/null || true
	  if [ -n "$2" ]; then
		deb-systemd-invoke restart "${SERVICE}" >/dev/null || true
	  else
		deb-systemd-invoke start "${SERVICE}" >/dev/null || true
	  fi
    ;;
esac

exit 0