summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_mgr_install.php
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-06-07 18:43:03 +0000
committerColin Smith <colin@pfsense.org>2005-06-07 18:43:03 +0000
commite1531d0066443324f5c803a2ad5d51ab7b69444d (patch)
tree2f1250b2c27e71105516a9498eed5179c61bfaba /usr/local/www/pkg_mgr_install.php
parentc473adbcacddea98ab7703c80fd46777c48286e7 (diff)
downloadpfsense-e1531d0066443324f5c803a2ad5d51ab7b69444d.zip
pfsense-e1531d0066443324f5c803a2ad5d51ab7b69444d.tar.gz
Add support for XML (or package) reinstallation and package deletion.
Diffstat (limited to 'usr/local/www/pkg_mgr_install.php')
-rwxr-xr-xusr/local/www/pkg_mgr_install.php62
1 files changed, 41 insertions, 21 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index 5d79597..bcc400b 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -96,29 +96,49 @@ include("fbegin.inc");
</html>
<?php
-
-if($_GET['mode'] == 'reinstallall') {
- foreach($config['installedpackages']['package'] as $package) {
- $todo[] = array('name' => $package['name'], 'version' => $package['version']);
- }
- foreach($todo as $pkgtodo) {
- $static_output = "";
+switch($_GET['mode']) {
+ case "delete":
+ delete_package($_GET['pkg'] . '-' . $_GET['version']);
+ delete_package_xml($_GET['pkg']);
+ update_status("Package deleted.");
+ $static_output .= "\n\nPackage deleted.";
+ update_output_window($static_output);
+ break;
+ case "reinstallpkg":
+ delete_package($_GET['pkg'] . '-' . $_GET['version']);
+ delete_package_xml($_GET['pkg']);
+ install_package($_GET['pkg']);
+ update_status("Package reinstalled.");
+ $static_output .= "\n\nPackage reinstalled.";
update_output_window($static_output);
- delete_package($pkgtodo['name'] . '-' . $pkgtodo['version']);
- delete_package_xml($pkgtodo['name']);
- install_package($pkgtodo['name']);
- }
- update_status("All packages reinstalled.");
- $static_output .= "\n\nAll packages reinstalled.";
- update_output_window($static_output);
-} else {
- install_package($_GET['id']);
- update_status("Installation of {$_GET['id']} completed.");
- $static_output .= "\n\nInstallation completed.";
- update_output_window($static_output);
- echo "<p><center>Installation completed. Show <a href=\"pkg_mgr_install.php?id={$_GET['id']}&showlog=true\">install log</a></center>";
+ break;
+ case "reinstallxml":
+ delete_package_xml($_GET['pkg']);
+ install_package($_GET['pkg']);
+ $static_output .= "\n\nPackage reinstalled.";
+ update_output_window($static_output);
+ break;
+ case "reinstallall":
+ foreach($config['installedpackages']['package'] as $package) {
+ $todo[] = array('name' => $package['name'], 'version' => $package['version']);
+ }
+ foreach($todo as $pkgtodo) {
+ $static_output = "";
+ update_output_window($static_output);
+ delete_package($pkgtodo['name'] . '-' . $pkgtodo['version']);
+ delete_package_xml($pkgtodo['name']);
+ install_package($pkgtodo['name']);
+ }
+ update_status("All packages reinstalled.");
+ $static_output .= "\n\nAll packages reinstalled.";
+ update_output_window($static_output);
+ break;
+ default:
+ install_package($_GET['id']);
+ update_status("Installation of {$_GET['id']} completed.");
+ $static_output .= "\n\nInstallation completed.";
+ update_output_window($static_output);
}
-
// Delete all temporary package tarballs and staging areas.
unlink_if_exists("/tmp/apkg_*");
rmdir_recursive("/var/tmp/instmp*");
OpenPOWER on IntegriCloud