diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-11-22 23:53:56 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-11-22 23:53:56 +0000 |
commit | fe92851916d952ef9eb5bc8b974088ae426432f7 (patch) | |
tree | ccb78c102f6e7ee431a8ea0418d47a667574e28a /etc/phpshellsessions | |
parent | 864b397664a30be091a0b9b54eaf227aaad26002 (diff) | |
download | pfsense-fe92851916d952ef9eb5bc8b974088ae426432f7.zip pfsense-fe92851916d952ef9eb5bc8b974088ae426432f7.tar.gz |
Test php after cvssync. If you go backwards in time your PHP will puke.
If php pukes and a previous backup exists, just restore it.
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r-- | etc/phpshellsessions/cvssync | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/phpshellsessions/cvssync b/etc/phpshellsessions/cvssync index 09d833a..456d40d 100644 --- a/etc/phpshellsessions/cvssync +++ b/etc/phpshellsessions/cvssync @@ -172,6 +172,21 @@ function post_cvssync_commands() { exec("rm -rf /tmp/xcache/* 2>/dev/null"); + echo "===> Ensuring that PHP is working before going further..."; + $test_php = `php -v`; + if(!strstr($test_php, "PHP")) { + echo "OH NOES.\n+++> Ruh roh, you're PHP is now toast.\n"; + if(file_exists("/root/cvssync_backup.tgz")) { + echo "+++> Found previous CVSSync backup. Restoring..."; + mwexec("cd / && tar xzpfU /root/cvssync_backup.tgz -C /"); + echo "done.\n"; + } else { + echo "+++> Sorry, we could not locate a cvssync backup to restore from. Good luck rescuing your system! :( \n"; + } + } else { + echo "it's good!\n"; + } + echo "===> Upgrading configuration (if needed)...\n"; convert_config(); |