core/pkg/+POST_INSTALL
Franco Fichtner 0f2443ee72 rc: there's always something else that breaks...
Just move to the actual rc script in the repo from our hook and
revert back to a simple mount inside that one.  Problem solved.
2015-02-26 15:49:15 +01:00

26 lines
784 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 [ -f /root/core/src/etc/rc ]; then /root/core/src/etc/rc; exit 0;
elif [ -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
echo "Writing OPNsense version"
echo "%%REPO_VERSION%%-%%REPO_COMMENT%%" > /usr/local/etc/version