in reply to safe to use system

One suggestion, hardcode any path to programs/scripts that you want to access in the script, just in case because you are running the script as root. And make sure only root can modify the script.