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
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
# 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.