Introduce CUSTOM_LOGO_TEXT env variable

This commit is contained in:
vnxme 2024-12-16 18:46:01 +03:00
parent ba72caaead
commit 5a75108737
3 changed files with 6 additions and 3 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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)
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") 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 '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} ...") 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")