11#! /bin/sh
22
3+ set -e
4+
35if [ ! -d /etc/devolutions-gateway ]; then
46 /bin/mkdir /etc/devolutions-gateway
5- /bin/chmod 655 /etc/devolutions-gateway
7+ /bin/chmod 750 /etc/devolutions-gateway
68fi
79
8- if [ -d /run/systemd/system ]; then
9- # Generate /etc/devolutions-gateway/gateway.json
10- /usr/bin/devolutions-gateway --config-init-only > /dev/null
11- fi
10+ /usr/bin/devolutions-gateway --config-init-only > /dev/null
1211
13- set -e
1412# Automatically added by dh_installsystemd/13.18ubuntu2.1
1513if [ " $1 " = " configure" ] || [ " $1 " = " abort-upgrade" ] || [ " $1 " = " abort-deconfigure" ] || [ " $1 " = " abort-remove" ] ; then
1614 # The following line should be removed in trixie or trixie+1
@@ -33,11 +31,21 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon
3331 if [ -z " ${DPKG_ROOT:- } " ] && [ -d /run/systemd/system ]; then
3432 systemctl --system daemon-reload > /dev/null || true
3533 if [ -n " $2 " ]; then
36- _dh_action=restart
37- else
38- _dh_action=start
34+ # Upgrade: restart only if already running.
35+ deb-systemd-invoke try-restart ' devolutions-gateway.service' > /dev/null || true
3936 fi
40- deb-systemd-invoke $_dh_action ' devolutions-gateway.service' > /dev/null || true
4137 fi
4238fi
4339# End automatically added section
40+
41+ if [ " $1 " = " configure" ] && [ -z " $2 " ]; then
42+ echo " "
43+ echo " Devolutions Gateway has been installed."
44+ echo " Edit /etc/devolutions-gateway/gateway.json, then run:"
45+ if [ -d /run/systemd/system ]; then
46+ echo " systemctl start devolutions-gateway"
47+ else
48+ echo " Start devolutions-gateway using your init system or run it directly."
49+ fi
50+ echo " "
51+ fi
0 commit comments