diff options
author | sullrich <sullrich@pfsense.org> | 2009-12-05 15:59:05 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-12-05 15:59:05 -0500 |
commit | 51a2e892217b4a84db8b97771fd09ef762813c74 (patch) | |
tree | 2cd9f388f9c929296b98c322917baa3cd78bd084 /etc/phpshellsessions | |
parent | 0d7b21de687a411ef47da58e0ea64c474a9fa6fb (diff) | |
download | pfsense-51a2e892217b4a84db8b97771fd09ef762813c74.zip pfsense-51a2e892217b4a84db8b97771fd09ef762813c74.tar.gz |
Cleanup after sync
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r-- | etc/phpshellsessions/gitsync | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 92c601e..18268c4 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -123,12 +123,18 @@ if(is_dir("$CODIR/pfSenseGITREPO/pfSenseGITREPO")) { exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git fetch"); exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git clean -f -f -x -d"); if($branch == "master") { - exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard HEAD"); - exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin"); + $git_cmd = array( + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard", + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin" + ); + run_cmds($git_cmd); } else { - exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard HEAD"); - exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin/$branch"); + $git_cmd = array( + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset HEAD --hard", + "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git rebase origin/$branch" + ); } + run_cmds($git_cmd); } else { exec("mkdir -p $CODIR/pfSenseGITREPO"); echo "Executing cd $CODIR/pfSenseGITREPO && git clone $GIT_REPO pfSenseGITREPO\n"; @@ -179,6 +185,8 @@ exec($command); post_cvssync_commands(); +run_cmds($git_cmd); + echo "===> Checkout complete.\n"; echo "\n"; echo "Your system is now sync'd and PHP and Lighty will be restarted in 5 seconds.\n\n"; @@ -237,4 +245,11 @@ function isUrl($url = "") { return false; } +function run_cmds($cmds) { + foreach($cmds as $cmd) { + echo "Running $cmd"; + exec($cmd); + } +} + conf_mount_ro(); |