import re path = '/opt/fleetbase/console/app/index.html' with open(path, 'r') as f: content = f.read() replacements = [ ('Fleetbase Console', 'Biibaye - Delivery System'), ('content="#da532c"', 'content="#FF4500"'), ('content="#ffffff"', 'content="#FF4500"'), ('href="/favicon/apple-touch-icon.png"', 'href="/favicon/apple-icon-180x180.png"'), ('href="/favicon/android-chrome-192x192.png"', 'href="/favicon/android-icon-192x192.png"'), ('href="/favicon/android-chrome-256x256.png"', 'href="/favicon/android-icon-144x144.png"'), ('color="#5bbad5"', 'color="#FF4500"'), ] for old, new in replacements: if old not in content: print(f'WARNING: pattern not found: {old}') content = content.replace(old, new) with open(path, 'w') as f: f.write(content) print('index.html patched successfully')