Bash scripting help (su ...)
Hi,
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
Password:
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
best regards,
siew hui
|