+POST_INSTALL 828 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
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 "Hooking into /etc/rc"
cp /etc/rc /etc/rc.bak
12
cat > /etc/rc <<EOF
13 14
#!/bin/sh
# OPNsense rc(8) hook was automatically installed:
15 16
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
17
EOF
18 19
cat /etc/rc.bak >> /etc/rc
rm -f /etc/rc.bak
20 21

echo "Writing OPNsense version"
22 23
mkdir -p /usr/local/opnsense/version
echo "%%REPO_VERSION%%-%%REPO_COMMENT%%" > /usr/local/opnsense/version/opnsense
24

25 26
if /usr/local/etc/rc.d/configd status > /dev/null; then
	/usr/local/etc/rc.d/configd restart
27
fi