Skip to content

Instantly share code, notes, and snippets.

@ringanta
Last active August 12, 2023 14:29
Show Gist options
  • Save ringanta/4499211 to your computer and use it in GitHub Desktop.
Save ringanta/4499211 to your computer and use it in GitHub Desktop.
#!/bin/bash
# install vnc server on Amazon Linux AMI
# Created by Roy Inganta
TARGET=/usr/local
function init(){
export installroot=$TARGET/src
export workpath=$TARGET
# install depedencies
yum --assumeyes install xorg-x11-xauth xorg-x11-fonts-misc
mkdir -p $workpath
mkdir -p $installroot
cd $installroot
}
function install(){
FILE=`basename $1`
if [ ! -e $FILE ]
then
wget $1
fi
rpm -ivh $FILE
}
function finish(){
cd ~
echo "Setup Password for you VNC Server"
vncpasswd
}
which vncserver
if [ $? == 0 ]
then
echo "VNC Server has been installed on your machine"
exit 0
fi
init
install ftp://rpmfind.net/linux/centos/5.8/os/x86_64/CentOS/vnc-server-4.1.2-14.el5_6.6.x86_64.rpm
finish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment