I'm fairly new to Ubuntu and I'm tying to write a .sh script that starts up 2 postgres servers. I disabled pw requirement for sudo in /etc/sudoers
here is my script so far and it's probably incorrect.
#!/bin/bash sudo su postgres postgres -D /usr/local/mydb1 -p <port no.> & postgres -D /usr/local/mydb2/data -p <diff port no.> &
The outcome I get after running the script:
shafin@shafin-VirtualBox:~/Desktop$ ./test.sh postgres@shafin-VirtualBox:/home/shafin/Desktop$
Looks like it's only executing the first line of the script.
can anyone please help?