core/pkg/+POST_INSTALL
Franco Fichtner eaed16aeb3 pkg: move the automount to /etc/rc so that...
/usr/local/etc/rc is always the latest version.  Issue
popped up again since check_reload_status was replaced.
2015-02-25 08:12:12 +01:00

23 lines
679 B
Plaintext

echo "Updating /etc/shells"
cp /etc/shells /etc/shells.bak
(grep -v /usr/local/etc/rc.initial /etc/shells.bak; \
echo /usr/local/etc/rc.initial) > /etc/shells
rm -f /etc/shells.bak
echo "Registering root shell"
pw usermod -n root -s /usr/local/etc/rc.initial
echo "Disabling FreeBSD mirror"
sed -i "" -e "s/^ enabled: yes$/ enabled: no/" /etc/pkg/FreeBSD.conf
echo "Hooking into /etc/rc"
cp /etc/rc /etc/rc.bak
cat > /etc/rc <<EOF
#!/bin/sh
# OPNsense rc(8) hook was automatically installed:
if [ -d /root/core ]; then /usr/bin/make -C /root/core mount; fi
if [ -f /usr/local/etc/rc ]; then /usr/local/etc/rc; exit 0; fi
EOF
cat /etc/rc.bak >> /etc/rc
rm -f /etc/rc.bak