diff --git a/CHANGELOG b/CHANGELOG index 11e11f7..1dbd104 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.1.06......Add ability to manually update bastille core files. 1.1.05......Fix a bug to display correct VNET interface. 1.1.04......Fix a bug that prevents VNET jail creation. 1.1.03......Add patch to improve ZFS activation, contributed by disaster. diff --git a/bastille-init b/bastille-init index 1ec55ec..f7fa0ef 100755 --- a/bastille-init +++ b/bastille-init @@ -224,6 +224,32 @@ bastille_upgrade() fi } +bastille_core_update() +{ + # Check if bastille already exist. + + if [ -f "${CWDIR}/${FULLAPPNAME}${BASTILLEPATH}/${APPNAME}" ]; then + # Fetch latest bastille package. + echo "Fetching ${APPNAME} files..." + fetch -ao ${CWDIR}/${BRANCH}.zip --no-verify-peer --timeout=30 ${BATSILLE_URL} || \ + error_notify "Error: A problem has occurred while fetching ${APPNAME}." + bastille_pkg_extract + fi + + if [ -f "${CWDIR}/${BRANCH}.zip" ] && [ -f "${CWDIR}/${FULLAPPNAME}${BASTILLEPATH}/${APPNAME}" ]; then + echo "Extracting ${APPNAME}..." + tar -xf ${CWDIR}/${BRANCH}.zip --exclude='.git*' --exclude='docs' --exclude='bastille.conf' --strip-components 1 -C ${CWDIR}/${FULLAPPNAME} || \ + error_notify "Error: A problem has occurred while extractig ${APPNAME} files." + chmod 555 ${CWDIR}/${FULLAPPNAME}${BASTILLEPATH}/${APPNAME} + chmod 555 ${CWDIR}/${FULLAPPNAME}${BASTILLERCD} + rm -f ${CWDIR}/${BRANCH}.zip + echo "Done!" + fi + + echo "${PRDNAME} core package update completed!" + exit 0 +} + ext_initial_download() { # Always ensure the version file is present, otherwise update the extension files on startup. @@ -1314,6 +1340,9 @@ clean|--clean) linux_compat) linux_compat ;; +bastillebsd_update) + bastille_core_update + ;; esac while getopts ":ospruxUvgtZh" option; do diff --git a/gui/bastille_manager_maintenance.php b/gui/bastille_manager_maintenance.php index b6c346c..659a48c 100644 --- a/gui/bastille_manager_maintenance.php +++ b/gui/bastille_manager_maintenance.php @@ -90,6 +90,24 @@ if ($_POST) { endif; endif; + if(isset($_POST['update']) && $_POST['update']): + $cmd = sprintf('%1$s/bastille-init bastillebsd_update > %2$s',$rootfolder,$logevent); + $return_val = 0; + $output = []; + exec($cmd,$output,$return_val); + if($return_val == 0): + ob_start(); + include("{$logevent}"); + $ausgabe = ob_get_contents(); + ob_end_clean(); + $savemsg .= str_replace("\n", "
", $ausgabe)."
"; + else: + $input_errors[] = gtext('An error has occurred during core update process.'); + $cmd = sprintf('echo %s: %s An error has occurred during core update process. >> %s',$date,$application,$logfile); + exec($cmd); + endif; + endif; + // Remove only extension related files during cleanup. if (isset($_POST['uninstall']) && $_POST['uninstall']) { if(isset($_POST['delete_confirm']) && $_POST['delete_confirm']): @@ -335,6 +353,7 @@ $(document).ready(function(){
" value=""/> " value="" /> + " value="" /> " value="" />
diff --git a/version b/version index 0ce14c1..d835981 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.05 +1.1.06