2

Every time I deploy a VPS server, I install VNC server.

But every time I have to do this:

yum groupinstall Desktop
yum install tigervnc-server
yum install vnc
yum install firefox

(etc.)

Can I write an automated .sh script/file (or something else) that I could run on every server to install VNC server automatically? If so, how?

1
  • 1
    For a start version, put those lines in a file myPosInstall and do sh myPosInstall. Next add first line #!/bin/bash , chmod 755 myPosInstall and do ./myPostInstall
    – JJoao
    Jul 20, 2015 at 14:21

1 Answer 1

2

You would need to make a simple script (say "setup"). Just type text_editor_of_choice setup and then add these lines:

#!/bin/bash
yum groupinstall Desktop
yum install tigervnc-server
yum install vnc
yum install firefox
Et cetera...
Then save the file and type chmod +x setup to make it executable. Now all you have to do is run it with bash setup.

Cheers,
Interesting...

1
  • 2
    You don't actually need to chmod +x setup if you're invoking the script via the bash executable. You'd only need to add execute permissions if you're executing the script directly, e.g. ./setup
    – villapx
    Dec 13, 2017 at 18:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .