I've found the way to reload Geoserver by REST (Geoserver Configuration Reload), but my issue is about security of that solution. My reload request is fired from a bash script periodically, so it's written in file. Is there a way to hide the password from other users with root access to the server?
It's hard, but not impossible, to hide a password, even from root. The trick is to save the password in a password protected keyring (like the Gnome Keyring), unlock the Keyring once and then (from the same session!) run a script like the following (written in python). Please note that even if root can su to your account he still cannot open the Keyring because he has to unlock it first. Unfortunately the password will be visibile to any user viewing the process list on the machine, but that was not the question.
Please remember: you will have to unlock the keyring and then leave that very same session open. Until your session is open the script will happily fetch the password and launch the curl command, but the python script has to run from the same session. If the session is closed for any reason (timeout, reboot, plague, locusts) you will have to manually start a new one.
Read more on the Gnome Keyring.