-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect.uni
executable file
·20 lines (20 loc) · 1.03 KB
/
connect.uni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# This script automates connection to the curtin computing lab specified
# Works best if you have uploaded an ssh key
# Define some variables - note plain text passwords represent a security risk, use at you own disretion
user='08832256'
passwd='Ironman!968'
lab='lab218-a01.cs.curtin.edu.au'
# Connect to the curtin vpn using openconnect
sudo echo "$passwd"|sudo openconnect -u "$user" --passwd-on-stdin -b https://sslvpn.curtin.edu.au/
# Gets ths pid of the process openconnect is running on
echo $!
# This line connects to the lab computer via ssh, you will be prompted for a password
# if you have not uploaded a shh-key via ssh-copy-id
#ssh [email protected];
#ssh $user@$lab;
echo sshfs -o follow_symlinks "$user"@"$lab":/home/"$user"/ ~/Curtin/
sshfs -o follow_symlinks "$user"@"$lab":/home/"$user"/ ~/Curtin/
# You can remove the echos if you want to run the commands in the script.
echo sudo killall -9 openconnect will close all instances of openconnect.
echo sudo kill $ocpid should kill only this instance.