Bash scripting help (su ...)
A basic bash scripter, i need help in writing a script that requires a User "apache" to restart postgresql.
[apache@xxx apache]$ service postgresql restart
I've tried creating a file that contained the password, "pword". But it didn't worked:
[apache@xxx apache]$ su - root <pword
standard in must be a tty
How to i write a script to enter the password automatically?
Any other solutions to restart the postgresql as an apache user is very much appreciated. Thank you in advance for your time