diff --git a/plugins/dynamix/FlashInfo.page b/plugins/dynamix/FlashInfo.page index 49fa0dea7..38fee215f 100644 --- a/plugins/dynamix/FlashInfo.page +++ b/plugins/dynamix/FlashInfo.page @@ -13,6 +13,34 @@ Title="Flash Device Settings" * all copies or substantial portions of the Software. */ ?> + + + + Flash Vendor: : @@ -35,4 +63,6 @@ Flash GUID:   -: +: + +
diff --git a/plugins/dynamix/include/Download.php b/plugins/dynamix/include/Download.php index 77a3dfe18..b110cce7f 100644 --- a/plugins/dynamix/include/Download.php +++ b/plugins/dynamix/include/Download.php @@ -11,7 +11,7 @@ */ ?> ')+2); + exec("rm -f '$docroot/$file' '$disk'"); + break; +case 'backup': + echo exec("$docroot/webGui/scripts/usb_backup"); + break; +} ?> diff --git a/plugins/dynamix/scripts/usb_backup b/plugins/dynamix/scripts/usb_backup new file mode 100644 index 000000000..f31c98913 --- /dev/null +++ b/plugins/dynamix/scripts/usb_backup @@ -0,0 +1,43 @@ +#!/usr/bin/php -q + + $used; +foreach (glob('/mnt/user/*',GLOB_ONLYDIR) as $share) { + $free = exec("df $share|awk 'END{print $4}'"); + if ($free > $used) {$zip = $share; break;} +} +$zip = $zip ? "$zip/$backup" : ($usb ? "/boot/$backup" : ""); +if ($zip) { + chdir("/boot"); + foreach (glob("*",GLOB_NOSORT+GLOB_ONLYDIR) as $folder) { + if (in_array($folder,$out)) continue; + exec("zip -qr ".escapeshellarg($zip)." ".escapeshellarg($folder)); + } + foreach (glob("*",GLOB_NOSORT) as $file) { + if (is_dir($file)) continue; + exec("zip -q ".escapeshellarg($zip)." ".escapeshellarg($file)); + } + symlink($zip,"$docroot/$backup"); + echo $backup; +} +?> \ No newline at end of file