mirror of
https://github.com/elseif/MikroTikPatch.git
synced 2025-01-23 21:44:59 +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 }}
|
CUSTOM_RENEW_URL: ${{ secrets.CUSTOM_RENEW_URL }}
|
||||||
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
||||||
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
||||||
|
CUSTOM_LOGO_TEXT: ${{ secrets.CUSTOM_LOGO_TEXT }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Set_BuildTime:
|
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 }}
|
CUSTOM_RENEW_URL: ${{ secrets.CUSTOM_RENEW_URL }}
|
||||||
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
MIKRO_CLOUD_URL: ${{ secrets.MIKRO_CLOUD_URL }}
|
||||||
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
CUSTOM_CLOUD_URL: ${{ secrets.CUSTOM_CLOUD_URL }}
|
||||||
|
CUSTOM_LOGO_TEXT: ${{ secrets.CUSTOM_LOGO_TEXT }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Set_BuildTime:
|
Set_BuildTime:
|
||||||
|
7
patch.py
7
patch.py
@ -303,9 +303,10 @@ def patch_npk_package(package,key_dict):
|
|||||||
print(f"extract {squashfs_file} ...")
|
print(f"extract {squashfs_file} ...")
|
||||||
run_shell_command(f"unsquashfs -d {extract_dir} {squashfs_file}")
|
run_shell_command(f"unsquashfs -d {extract_dir} {squashfs_file}")
|
||||||
patch_squashfs(extract_dir,key_dict)
|
patch_squashfs(extract_dir,key_dict)
|
||||||
logo = os.path.join(extract_dir,"nova/lib/console/logo.txt")
|
if ('CUSTOM_LOGO_TEXT' in os.environ) and (len(os.environ['CUSTOM_LOGO_TEXT']) > 0):
|
||||||
run_shell_command(f"sudo sed -i '1d' {logo}")
|
logo = os.path.join(extract_dir,"nova/lib/console/logo.txt")
|
||||||
run_shell_command(f"sudo sed -i '8s#.*# elseif@live.cn https://github.com/elseif/MikroTikPatch#' {logo}")
|
run_shell_command(f"sudo sed -i '1d' {logo}")
|
||||||
|
run_shell_command(f"sudo sed -i '8s#.*#{os.environ['CUSTOM_LOGO_TEXT']}#' {logo}")
|
||||||
print(f"pack {extract_dir} ...")
|
print(f"pack {extract_dir} ...")
|
||||||
run_shell_command(f"rm -f {squashfs_file}")
|
run_shell_command(f"rm -f {squashfs_file}")
|
||||||
run_shell_command(f"mksquashfs {extract_dir} {squashfs_file} -quiet -comp xz -no-xattrs -b 256k")
|
run_shell_command(f"mksquashfs {extract_dir} {squashfs_file} -quiet -comp xz -no-xattrs -b 256k")
|
||||||
|
Loading…
Reference in New Issue
Block a user