mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 13:35:09 +03:00
Introduce CUSTOM_LOGO_TEXT env variable
This commit is contained in:
parent
ba72caaead
commit
5a75108737
1
.github/workflows/mikrotik_patch_6.yml
vendored
1
.github/workflows/mikrotik_patch_6.yml
vendored
@ -27,6 +27,7 @@ env:
|
||||
CUSTOM_RENEW_URL: ${{ secrets.CUSTOM_RENEW_URL }}
|
||||
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
||||
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
||||
CUSTOM_LOGO_TEXT: ${{ secrets.CUSTOM_LOGO_TEXT }}
|
||||
|
||||
jobs:
|
||||
Set_BuildTime:
|
||||
|
1
.github/workflows/mikrotik_patch_7.yml
vendored
1
.github/workflows/mikrotik_patch_7.yml
vendored
@ -26,6 +26,7 @@ env:
|
||||
CUSTOM_RENEW_URL: ${{ secrets.CUSTOM_RENEW_URL }}
|
||||
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
||||
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
||||
CUSTOM_LOGO_TEXT: ${{ secrets.CUSTOM_LOGO_TEXT }}
|
||||
|
||||
jobs:
|
||||
Set_BuildTime:
|
||||
|
3
patch.py
3
patch.py
@ -303,9 +303,10 @@ def patch_npk_package(package,key_dict):
|
||||
print(f"extract {squashfs_file} ...")
|
||||
run_shell_command(f"unsquashfs -d {extract_dir} {squashfs_file}")
|
||||
patch_squashfs(extract_dir,key_dict)
|
||||
if ('CUSTOM_LOGO_TEXT' in os.environ) and (len(os.environ['CUSTOM_LOGO_TEXT']) > 0):
|
||||
logo = os.path.join(extract_dir,"nova/lib/console/logo.txt")
|
||||
run_shell_command(f"sudo sed -i '1d' {logo}")
|
||||
run_shell_command(f"sudo sed -i '8s#.*# elseif@live.cn https://github.com/elseif/MikroTikPatch#' {logo}")
|
||||
run_shell_command(f"sudo sed -i '8s#.*#{os.environ['CUSTOM_LOGO_TEXT']}#' {logo}")
|
||||
print(f"pack {extract_dir} ...")
|
||||
run_shell_command(f"rm -f {squashfs_file}")
|
||||
run_shell_command(f"mksquashfs {extract_dir} {squashfs_file} -quiet -comp xz -no-xattrs -b 256k")
|
||||
|
Loading…
Reference in New Issue
Block a user