opnsense-core/+POST_INSTALL
Franco Fichtner 4e2b0079df firmware: narrow window for update-related crash reports
Sync PHP config and PHP directly after installation of the new package
in order to avoid errors for missing files or modules.
2016-05-17 12:18:22 +02:00

38 lines
1.1 KiB
Text

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
cat > /etc/rc <<EOF
#!/bin/sh
# OPNsense rc(8) hook was automatically installed:
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
echo "Writing package version"
mkdir -p /usr/local/opnsense/version
if [ -f /usr/local/opnsense/version/opnsense ]; then
mv /usr/local/opnsense/version/opnsense /usr/local/opnsense/version/opnsense.last
fi
echo "%%CORE_COMMIT%%" > /usr/local/opnsense/version/opnsense
if /usr/local/etc/rc.d/configd status > /dev/null; then
/usr/local/etc/rc.d/configd restart
fi
echo "Flush Phalcon volt templates"
rm -f /usr/local/opnsense/mvc/app/cache/*.php
echo "Reloading GUI configuration"
/usr/local/etc/rc.php_ini_setup
if pgrep -q php-cgi; then
pkill -HUP php-cgi
fi