core/pkg/+POST_INSTALL
Franco Fichtner 797b0e64b8 src: migrate the version file to a new home
We now use /usr/local/opnsense/version/xxx as our version database.
Apart from the core package, opnsense-update(8) also puts its own
version information in there.  To stay somewhat consistent, the
version file should resemble the package name, even though that
looks strange in our case: /usr/local/opnsense/version/opnsense.
It's just that /usr/local/etc is too open and might clash with
other things in the future.
2015-03-02 09:08:44 +01:00

27 lines
835 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"
mkdir -p /usr/local/opnsense/version
echo "%%REPO_VERSION%%-%%REPO_COMMENT%%" > /usr/local/opnsense/version/opnsense