Skip to content

Commit

Permalink
Improved upgrade process, how using config file
Browse files Browse the repository at this point in the history
  • Loading branch information
seba76 committed Apr 6, 2020
1 parent 2494f8a commit f6f243b
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 281 deletions.
4 changes: 4 additions & 0 deletions spk/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ RESULTING FROM INSTALLING THIS PACKAGE!

CHANGELOG
=====
Version: 6.1.4-136177
Improved upgrade process
Changed udev rule file name

Version: 6.0.8-130520
Improved upgrade process, fixed few install bugs

Expand Down
67 changes: 0 additions & 67 deletions spk/WIZARD_UIFILES/install_uifile

This file was deleted.

107 changes: 107 additions & 0 deletions spk/WIZARD_UIFILES/install_uifile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/bin/sh

/bin/cat > /tmp/wizard.php <<'EOF'
<?php
$ini_array = parse_ini_file("/var/packages/virtualbox4dsm/target/.config");
# page1
$wizard_on_stop_poweroff=$ini_array["wizard_on_stop_poweroff"];
$wizard_on_stop_acpibutton=$ini_array["wizard_on_stop_acpibutton"];
$wizard_on_stop_savestate=$ini_array["wizard_on_stop_savestate"];
$wizard_virtualbox_share=$ini_array["wizard_virtualbox_share"];
# page2
$wizard_bind_ip=$ini_array["wizard_bind_ip"];
$wizard_use_https=$ini_array["wizard_use_https"];
$wizard_use_vboxwebsvc_pass=$ini_array["wizard_use_vboxwebsvc_pass"];
$wizard_enable_wol=$ini_array["wizard_enable_wol"];
# page1 defaults
if (empty($wizard_on_stop_poweroff)) $wizard_on_stop_poweroff = false;
if (empty($wizard_on_stop_acpibutton)) $wizard_on_stop_acpibutton = true;
if (empty($wizard_on_stop_savestate)) $wizard_on_stop_savestate = false;
if (empty($wizard_virtualbox_share)) $wizard_virtualbox_share = "virtualbox";
# page2 defaults
if (empty($wizard_bind_ip)) $wizard_bind_ip = "127.0.0.1";
if (empty($wizard_use_https)) $wizard_use_https = "false";
if (empty($wizard_use_vboxwebsvc_pass)) $wizard_use_vboxwebsvc_pass = "B24Lq3OfG24S";
if (empty($wizard_enable_wol)) $wizard_enable_wol = "false";
echo <<<EOF
[
{
"step_title": "VirtualBox configuration (page 1 of 2)",
"items": [{
"type": "singleselect",
"desc": "On DSM shutdown what to do with running Guest VM?",
"subitems": [{
"key": "wizard_on_stop_poweroff",
"desc": "poweroff",
"defaultValue": $wizard_on_stop_poweroff }, {
"key": "wizard_on_stop_acpibutton",
"desc": "acpibutton",
"defaultValue": $wizard_on_stop_acpibutton }, {
"key": "wizard_on_stop_savestate",
"desc": "savestate",
"defaultValue": $wizard_on_stop_savestate
}]
},
{
"type": "textfield",
"desc": "Shared folder for VirtualBox VMs (e.g. virtualbox) will be created on first live volume.",
"subitems": [{
"key": "wizard_virtualbox_share",
"desc": "Shared folder",
"defaultValue": "$wizard_virtualbox_share"
}]
}]
},
{
"step_title": "VirtualBox configuration (page 2 of 2)",
"items": [
{
"type": "textfield",
"desc": "Vboxwebsrv SOAP service bind IP (not phpVirtualBox's URL)",
"subitems": [{
"key": "wizard_bind_ip",
"desc": "Bind to IP",
"defaultValue": "$wizard_bind_ip"
}]
},
{
"type": "multiselect",
"desc": "Should vboxwebsrv use HTTPS protocol (useful if bind IP is not 127.0.0.1).",
"subitems": [{
"key": "wizard_use_https",
"desc": "Use HTTPS",
"defaultValue": $wizard_use_https
}]
},
{
"type": "textfield",
"desc": "Authentication password for vboxwebsrv , used if bind IP is not 127.0.0.1",
"subitems": [{
"key": "wizard_use_vboxwebsvc_pass",
"desc": "vboxwebsvc password",
"defaultValue": "$wizard_use_vboxwebsvc_pass"
}]
},
{
"type": "multiselect",
"desc": "Enable WOL for guest VM's, you will be able to wake VM by sending standard magic packet to port 9 and VM's MAC address",
"subitems": [{
"key": "wizard_enable_wol",
"desc": "Enable WOL for VM",
"defaultValue": $wizard_enable_wol
}]
}]
}
];
EOF;
?>
EOF

/usr/bin/php -n /tmp/wizard.php > $SYNOPKG_TEMP_LOGFILE
rm /tmp/wizard.php
exit 0
67 changes: 0 additions & 67 deletions spk/WIZARD_UIFILES/install_uifile_enu

This file was deleted.

1 change: 1 addition & 0 deletions spk/WIZARD_UIFILES/install_uifile_enu.sh
67 changes: 0 additions & 67 deletions spk/WIZARD_UIFILES/upgrade_uifile

This file was deleted.

1 change: 1 addition & 0 deletions spk/WIZARD_UIFILES/upgrade_uifile.sh
67 changes: 0 additions & 67 deletions spk/WIZARD_UIFILES/upgrade_uifile_enu

This file was deleted.

1 change: 1 addition & 0 deletions spk/WIZARD_UIFILES/upgrade_uifile_enu.sh
Loading

0 comments on commit f6f243b

Please sign in to comment.