X-Git-Url: https://git.toastfreeware.priv.at/debian/iodine.git/blobdiff_plain/fd09620a41c11ddd63e5c6b9d188173bfaf97eaf..eb26ade432143f1423f48345721c6f8f384de312:/debian/postinst?ds=inline diff --git a/debian/postinst b/debian/postinst index 61d5fdd..477a89e 100644 --- a/debian/postinst +++ b/debian/postinst @@ -27,10 +27,10 @@ case "$1" in echo "Creating device /dev/net/tun ..." cd /dev ./MAKEDEV tun || true - fi + fi # and we want a special user - adduser --quiet --system --home /var/run/iodine iodine + adduser --quiet --system --home /run/iodine iodine # generate/update /etc/default/iodine if [ ! -e $CONFIGFILE ]; then @@ -61,9 +61,12 @@ EOF test -z "$IODINED_PASSWORD" || grep -Eq '^ *IODINED_PASSWORD=' $CONFIGFILE || \ echo "IODINED_PASSWORD=" >> $CONFIGFILE - perl -p -e "s{^ *START_IODINED=.*}{START_IODINED=\"$START_IODINED\"}; \ - s{^ *IODINED_ARGS=.*}{IODINED_ARGS=\"$IODINED_ARGS\"}; \ - s{^ *IODINED_PASSWORD=.*}{IODINED_PASSWORD=\"$IODINED_PASSWORD\"};" \ + # PATTERN may contain variables, which will be interpolated every time the pattern search + # is evaluated, except for when the delimiter is a single quote. + # (perldoc perlop) + perl -p -e "s'^ *START_IODINED=.*'START_IODINED=\"$START_IODINED\"'; \ + s'^ *IODINED_ARGS=.*'IODINED_ARGS=\"$IODINED_ARGS\"'; \ + s'^ *IODINED_PASSWORD=.*'IODINED_PASSWORD=\"$IODINED_PASSWORD\"';" \ < $CONFIGFILE > $CONFIGFILE.tmp mv -f $CONFIGFILE.tmp $CONFIGFILE @@ -82,6 +85,14 @@ esac # tell debconf we are done. otherwise, it hangs waiting for the daemon. db_stop; +# mask iodined.service if START_IODINED is not set to true +# this mimicks the behaviour of sysvinit. cf. #832599 +if [ "$1" = "configure" ] ; then + if [ "$START_IODINED" != "true" ] ; then + deb-systemd-helper mask iodined.service >/dev/null || true + fi +fi + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts.