diff --git a/README.md b/README.md new file mode 100644 index 0000000..596510c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Description -> will follow soon! diff --git a/onebuttoninstaller_install.php b/onebuttoninstaller_install.php index af7ba25..681ad4c 100644 --- a/onebuttoninstaller_install.php +++ b/onebuttoninstaller_install.php @@ -7,10 +7,13 @@ $release = explode("-", exec("uname -r")); if ($release[0] >= 9.3) $verify_hostname = "--no-verify-hostname"; else $verify_hostname = ""; -$return_val = mwexec("fetch {$verify_hostname} -vo onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true); +$install_dir = dirname(__FILE__); // get directory where the installer script resides +if (!is_dir("{$install_dir}/onebuttoninstaller")) { mkdir("{$install_dir}/onebuttoninstaller", 0775, true); } + +$return_val = mwexec("fetch {$verify_hostname} -vo {$install_dir}/onebuttoninstaller/onebuttoninstaller-install.php 'https://raw.github.com/crestAT/nas4free-onebuttoninstaller/master/onebuttoninstaller/onebuttoninstaller-install.php'", true); if ($return_val == 0) { - chmod("onebuttoninstaller/onebuttoninstaller-install.php", 0775); - require_once("onebuttoninstaller/onebuttoninstaller-install.php"); + chmod("{$install_dir}/onebuttoninstaller/onebuttoninstaller-install.php", 0775); + require_once("{$install_dir}/onebuttoninstaller/onebuttoninstaller-install.php"); } else { echo "\nInstallation file 'onebuttoninstaller-install.php' not found, installation aborted!\n"; } ?>