diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-02-26 19:26:49 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-02-26 19:26:49 +0000 |
commit | 4b4d599637b1aaf72df32de667828e514235dcb1 (patch) | |
tree | 91af9244f67f93bf08750cc6b820226294184290 /usr/local/www | |
parent | e08000ce3983bcc06ec92877eb12034079ff473d (diff) | |
download | pfsense-4b4d599637b1aaf72df32de667828e514235dcb1.zip pfsense-4b4d599637b1aaf72df32de667828e514235dcb1.tar.gz |
cat y out to pkg_add to automatically answer any nagging questions
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index 850c90f..6e095c7 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -239,10 +239,22 @@ foreach ($packages_to_install as $id) { update_progress_bar($pb_percent); $pb_percent += 10; + /* + * Open a /tmp/y file which will basically tell the + * pkg_delete script to delete users and such if it asks. + */ + $fd = fopen("/tmp/y", "w"); + fwrite($fd, "y\n"); + fwrite($fd, "y\n"); + fwrite($fd, "y\n"); + fwrite($fd, "y\n"); + fwrite($fd, "y\n"); + fclose($fd); + if ($pkgent['pfsense_package_base_url'] <> "") { - $text = exec_command_and_return_text("cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['pfsense_package_base_url'] . "/" . $pkgent['pfsense_package']); - update_output_window($text); fwrite($fd_log, "Executing: cd /tmp/ && /usr/sbin/pkg_add -r " . $pkgent['pfsense_package_base_url'] . "/" . $pkgent['pfsense_package'] . "\n" . $text); + $text = exec_command_and_return_text("cd /tmp/ && cat /tmp/y | /usr/sbin/pkg_add -r " . $pkgent['pfsense_package_base_url'] . "/" . $pkgent['pfsense_package']); + update_output_window($text); } update_progress_bar($pb_percent); @@ -430,13 +442,4 @@ echo "\n<script language=\"JavaScript\">document.progholder.style.visibility='hi -?> - - - - - - - - - +?>
\ No newline at end of file |