Skip to content

Commit

Permalink
Introduce CUSTOM_LOGO_TEXT env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxme committed Jan 21, 2025
1 parent ba72caa commit 5a75108
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/mikrotik_patch_6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mikrotik_patch_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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#.*# [email protected] https://github.com/elseif/MikroTikPatch#' {logo}")
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#.*#{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")
Expand Down

0 comments on commit 5a75108

Please sign in to comment.