mirror of
https://github.com/JRGTH/xigmanas-bastille-extension.git
synced 2026-01-04 03:44:08 +01:00
Added post upgrade function for convenience, cleanup
Added post upgrade function for convenience, cleanup obsolete code.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
======================
|
======================
|
||||||
Version Description
|
Version Description
|
||||||
|
|
||||||
|
1.2.03......Added post upgrade function for convenience, cleanup obsolete code.
|
||||||
1.2.02......Always execute extension script after upgrade from WebGUI, code changes.
|
1.2.02......Always execute extension script after upgrade from WebGUI, code changes.
|
||||||
1.2.01......Fix extension script missing statement preventing for new installs.
|
1.2.01......Fix extension script missing statement preventing for new installs.
|
||||||
1.2.00......Re-add Linux jail feature, WebGUI fixes and overall improvements.
|
1.2.00......Re-add Linux jail feature, WebGUI fixes and overall improvements.
|
||||||
|
|||||||
19
bastille-init
Executable file → Normal file
19
bastille-init
Executable file → Normal file
@@ -332,6 +332,8 @@ extension_upgrade()
|
|||||||
echo "* WARNING: System reboot is required when upgrading from v${CURRENTVER_FULL} to v${UPDATEVER_FULL} *"
|
echo "* WARNING: System reboot is required when upgrading from v${CURRENTVER_FULL} to v${UPDATEVER_FULL} *"
|
||||||
echo "***********************************************************************************"
|
echo "***********************************************************************************"
|
||||||
fi
|
fi
|
||||||
|
# Tell the extension was upgraded.
|
||||||
|
sysrc -f ${CWDIR}${EXTCONF} EXTENSION_UPGRADED="1" >/dev/null 2>&1
|
||||||
else
|
else
|
||||||
echo "Extension is on the latest version!"
|
echo "Extension is on the latest version!"
|
||||||
rm -R ${CWDIR}/update
|
rm -R ${CWDIR}/update
|
||||||
@@ -1197,6 +1199,22 @@ get_versions()
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_upgrade()
|
||||||
|
{
|
||||||
|
# Check/apply for required/pending updates/fixes if any.
|
||||||
|
# This file will be removed after success execution.
|
||||||
|
if sysrc -f ${CWDIR}${EXTCONF} -qc EXTENSION_UPGRADED=1; then
|
||||||
|
if [ -f "${CWDIR}/post_upgrade.sh" ]; then
|
||||||
|
echo "Executing post_upgrade.sh file..."
|
||||||
|
${CWDIR}/post_upgrade.sh
|
||||||
|
sleep 5
|
||||||
|
else
|
||||||
|
echo "Nothing to do."
|
||||||
|
fi
|
||||||
|
sysrc -f ${CWDIR}${EXTCONF} EXTENSION_UPGRADED="0" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
ext_start()
|
ext_start()
|
||||||
{
|
{
|
||||||
if sysrc -f ${CWDIR}${EXTCONF} -qc LINUX_COMPAT_SUPPORT=YES; then
|
if sysrc -f ${CWDIR}${EXTCONF} -qc LINUX_COMPAT_SUPPORT=YES; then
|
||||||
@@ -1221,6 +1239,7 @@ ext_start()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
post_upgrade
|
||||||
MSG="script has been started successfully!"
|
MSG="script has been started successfully!"
|
||||||
logger -t ${SCRIPTNAME} ${MSG}
|
logger -t ${SCRIPTNAME} ${MSG}
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -85,9 +85,6 @@ if ($_POST) {
|
|||||||
$output = [];
|
$output = [];
|
||||||
exec($cmd,$output,$return_val);
|
exec($cmd,$output,$return_val);
|
||||||
if($return_val == 0):
|
if($return_val == 0):
|
||||||
// Execute extension script after upgrade for convenience.
|
|
||||||
// This will cause the script to early trigger zfs config checks.
|
|
||||||
exec("{$rootfolder}/bastille-init");
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include("{$logevent}");
|
include("{$logevent}");
|
||||||
$ausgabe = ob_get_contents();
|
$ausgabe = ob_get_contents();
|
||||||
|
|||||||
Reference in New Issue
Block a user