gh-131: Fix postinstall ambiguous FreeBSD detection

pull/137/head
Vlastimil Holer 6 years ago
parent 65cbdc43f6
commit 96e621b959
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -10,7 +10,9 @@ rm -f /etc/udev/rules.d/70-persistent-net.rules
# Reload udev rules # Reload udev rules
udevadm control --reload >/dev/null 2>&1 || : udevadm control --reload >/dev/null 2>&1 || :
# Enable services
### Enable services ########################################
if which systemctl >/dev/null 2>&1 && \ if which systemctl >/dev/null 2>&1 && \
[ -d /etc/systemd ] && \ [ -d /etc/systemd ] && \
[ -f /usr/lib/systemd/system/one-context.service ]; [ -f /usr/lib/systemd/system/one-context.service ];
@ -46,14 +48,16 @@ elif which rc-update >/dev/null 2>&1; then
rc-update add "${S}" boot >/dev/null 2>&1 rc-update add "${S}" boot >/dev/null 2>&1
done done
elif [ -f /etc/rc.conf ]; then elif [ -x /bin/freebsd-version ]; then
: :
else else
echo 'WARNING: Contextualization service not enabled automatically' >&2 echo 'WARNING: Contextualization service not enabled automatically' >&2
fi fi
# Cleanup network configuration
### Cleanup network configuration ##########################
if [ "${NETWORK}" != 'yes' ]; then if [ "${NETWORK}" != 'yes' ]; then
exit exit
fi fi
@ -137,13 +141,15 @@ fi
# FreeBSD based distros # FreeBSD based distros
#TODO: pfsense paths? #TODO: pfsense paths?
if [ -f /etc/rc.conf ]; then if [ -x /bin/freebsd-version ]; then
rm -f /etc/rc.conf.d/network /etc/rc.conf.d/routing rm -f /etc/rc.conf.d/network /etc/rc.conf.d/routing
sed -i '' \ if [ -f /etc/rc.conf ]; then
-e '/^ifconfig_/d' \ sed -i '' \
-e '/^route_/d' \ -e '/^ifconfig_/d' \
-e '/^static_routes/d' \ -e '/^route_/d' \
-e '/^defaultrouter/d' \ -e '/^static_routes/d' \
/etc/rc.conf -e '/^defaultrouter/d' \
/etc/rc.conf
fi
fi fi

Loading…
Cancel
Save