forked from kohler/hotcrp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnode-install
31 lines (28 loc) · 923 Bytes
/
node-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Specify vnc password. This will run separate VNC terminal for each user on the machine
password=$1
apt update
apt install -y tightvncserver icewm xterm expect
cp /tmp/node/vncstart /usr/bin
chmod a+rx /usr/bin/vncstart
i=0
users=`ls /home | sort`
for user in $users; do
if [ "$user" == "test" ]; then
continue
fi
mkdir /home/$user/.vnc
chmod go-rwx /home/$user/.vnc
# Set up VNC server terminal options
cp /tmp/node/xstartup /home/$user/.vnc
chmod a+rx /home/$user/.vnc/xstartup
mkdir /home/$user/.icewm
cp /tmp/node/startup /home/$user/.icewm
chmod a+rx /home/$user/.icewm/startup
chown $user:$user -R /home/$user/.icewm
chown $user:$user -R /home/$user/.vnc
# Start VNC server
# Configure VNC password
echo "/usr/bin/vncstart $user $password $i"
sudo -u $user /usr/bin/vncstart $user $password $i
i=$(($i+1))
done