Old/New Script (Rescript v5.0)

Hi there, long time no posting or anything. Just wanted to share the script I made a long time ago with a bunch of changes. If this is usable for someone else other than me, you’re welcome to give it a try and give me some feedback. I know there are better tools out there, but I do like the old good bash.

2 Likes

Nice to see the script updated. One small thing I would double-check before people reuse it is the PRE_CMD handling: because it is run via eval, I would keep the config files non-world-writable and maybe mention that in the README near the security section. For a backup wrapper that is a pretty easy hardening win without changing the old-school bash style.

Thank you for pointing this out. This is an excellent catch.

Just to clarify, the script actually generates the config file with 700 permissions by default, so it’s strictly locked down to the owner and definitely not world-writable. However, you are absolutely right that keeping the configuration files tightly locked is a simple but critical hardening win, especially if users create or edit them manually.

I’ve just added an update to a new branch (where I’m testing upcoming changes) to implement your suggestions:

  1. The script now strictly uses chmod 600 instead of 700 when generating new .conf files to ensure they are not executable either.
  2. I’ve added a prominent warning block in the Security section of the README.md, explicitly explaining the privilege escalation risk associated with eval so users know why they must keep their configs locked down (e.g. 600) if they edit them manually.

Thanks again for taking the time to review it and for the feedback. It perfectly aligns with keeping the old-school bash style while staying secure.