Parse Remote Token, Update Scripts

Job ID: 40210983

Budget: €8 – €30 EUR

I run a small server that relies on a single token embedded in five local bash scripts. That token changes frequently and is published inside a public .m3u file on GitHub. What I need is a lightweight solution that runs every minute from cron, fetches that remote .m3u, pulls out both the URL and its accompanying token, and then slips the fresh values into each of the local scripts where they are currently hard-coded as script parameters.

Current state
• The five bash files already exist and work; they simply hold outdated, hard-coded parameters. so they probably need to be modified to run
like:
$token= "token.updated"
ffmpeg -i "blablabla/$token/channel/playlist.m3u8 -c copy blabla
• The .m3u has a consistent format, so the token and URL can be isolated reliably with a regex or similar parse.

Your task
1. Write a single script—bash or PHP would be easiest for me to maintain, but I’m open to whatever you feel is most robust.
2. Fetch the remote file over HTTPS, extract the URL and token, and validate that both are present.
3. Replace the old parameter values in each local bash file in-place (sed, awk, or other method is fine as long as the rest of each file is untouched).
4. Exit with clear logging so cron’s mail shows success or failure.

Acceptance
The job is complete when I can schedule the script with crontab -e to run * * * * * and observe:
• Remote fetch succeeds.
• All five local scripts update seamlessly.
• A quick manual run of any of those scripts proves the new token and URL are live.

Hand me the finished script plus a two-line README covering setup and dependencies, and we’re done.