-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
88 additions
and
709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
ini_set('memory_limit', '128M'); | ||
|
||
$fixed_version = "0.3.8"; | ||
|
||
function getUiVersion() { | ||
$versionFile = '/etc/neko/ui/meta/version.txt'; | ||
|
||
if (file_exists($versionFile)) { | ||
return trim(file_get_contents($versionFile)); | ||
} else { | ||
return $fixed_version; | ||
} | ||
} | ||
|
||
function writeVersionToFile($version) { | ||
$versionFile = '/etc/neko/ui/meta/version.txt'; | ||
file_put_contents($versionFile, $version); | ||
} | ||
|
||
$download_url = "https://github.com/Thaolga/neko/releases/download/$fixed_version/meta.tar"; | ||
$install_path = '/etc/neko/ui/meta'; | ||
$temp_file = '/tmp/meta-dist.tar'; | ||
|
||
if (!is_dir($install_path)) { | ||
mkdir($install_path, 0755, true); | ||
} | ||
|
||
$current_version = $fixed_version; | ||
|
||
if (isset($_GET['check_version'])) { | ||
echo "当前版本: $current_version\n"; | ||
echo "最新版本: $fixed_version\n"; | ||
exit; | ||
} | ||
|
||
exec("wget -O '$temp_file' '$download_url'", $output, $return_var); | ||
if ($return_var !== 0) { | ||
die("下载失败!"); | ||
} | ||
|
||
if (!file_exists($temp_file)) { | ||
die("下载的文件不存在!"); | ||
} | ||
|
||
echo "开始解压文件...\n"; | ||
exec("tar -xf '$temp_file' -C '$install_path'", $output, $return_var); | ||
if ($return_var !== 0) { | ||
echo "解压失败,错误信息: " . implode("\n", $output); | ||
die("解压失败!"); | ||
} | ||
echo "解压成功!\n"; | ||
|
||
exec("chown -R root:root '$install_path' 2>&1", $output, $return_var); | ||
if ($return_var !== 0) { | ||
echo "更改文件拥有者失败,错误信息: " . implode("\n", $output) . "\n"; | ||
die(); | ||
} | ||
echo "文件拥有者已更改为 root。\n"; | ||
|
||
writeVersionToFile($fixed_version); | ||
echo "更新完成!当前版本: $fixed_version\n"; | ||
|
||
unlink($temp_file); | ||
|
||
?> |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-47.2 KB
luci-app-nekobox/root/etc/neko/ui/meta/apple-touch-icon-precomposed.png
Binary file not shown.
1 change: 0 additions & 1 deletion
1
luci-app-nekobox/root/etc/neko/ui/meta/assets/BaseModal-56985af9.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
luci-app-nekobox/root/etc/neko/ui/meta/assets/BaseModal-e9f180d4.css
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
luci-app-nekobox/root/etc/neko/ui/meta/assets/Config-7eb3f1bb.css
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
luci-app-nekobox/root/etc/neko/ui/meta/assets/Config-ecaa0a4f.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.