Skip to content

Commit

Permalink
chore:update to v1.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasVon2021 committed Oct 28, 2024
1 parent 9f598f8 commit 44fc8a5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
8 changes: 3 additions & 5 deletions package/kvmd-web/install-kvmd-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ if [ -n "${pid}" ]; then
kill -9 "${pid}"
fi

if [ -f "/mnt/exec/release/config/user.json" ]; then
rsync -av --exclude 'config/user.json' release /mnt/exec/
else
cp -R release /mnt/exec
fi

cp -R release /mnt/exec


chmod 777 -R /mnt/exec/release

Expand Down
21 changes: 21 additions & 0 deletions script/install_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ def merge_config(existing_config, new_config):

print(f"The configuration file has been successfully merged and saved to {new_config_path}")

def compare_versions(version1, version2):
# Remove 'v' if it exists
if version1.startswith('v'):
version1 = version1[1:]
if version2.startswith('v'):
version2 = version2[1:]

v1 = list(map(int, version1.split('.')))
v2 = list(map(int, version2.split('.')))
return v1 >= v2

def main():
print("start install")
global gArgs
Expand Down Expand Up @@ -153,6 +164,16 @@ def main():
subprocess.check_output(cmd, shell = True, cwd=gArgs.releasepath )
print('restart kvmd-web successful')
merge_and_save_config('/tmp/config/app.json', '/mnt/exec/release/config/app.json')
# Check if the local file exists
if os.path.exists('/tmp/config/package.json'):
# Read the local configuration file
with open('/tmp/config/package.json', 'r', encoding='utf-8') as f:
local_config = json.load(f)
if 'version' in local_config:
version = local_config['version']
if compare_versions(version, '1.4.9'):
merge_and_save_config('/tmp/config/package.json', '/mnt/exec/release/config/package.json')


else:
print(gArgs.releasepath, ' not exit')
Expand Down
2 changes: 1 addition & 1 deletion script/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v1.4.8",
"version": "v1.4.9",
"md5value": "",
"oled":{
"oled_enable": 1,
Expand Down
1 change: 0 additions & 1 deletion web_src/config/user.json

This file was deleted.

2 changes: 1 addition & 1 deletion web_src/web_server

0 comments on commit 44fc8a5

Please sign in to comment.