-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmount391
executable file
·67 lines (60 loc) · 1.86 KB
/
mount391
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# instdir05.engr.illinois.edu/classes/ece391 = V:\ece391
# engr-ece-391.engr.illinois.edu/team/ece391/<your NETID> = Z:
# /Volumes = U: (x)
# After Mapping, ece391_* dirs will be used as these Volumes
# check if connected with campus WiFi
currentWiFi=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'
)
if [ "$currentWiFi" = "" ]
then
echo "No WiFi connection"
exit 1
else
if [ "$currentWiFi" = "IllinoisNet" ]||[ "$currentWiFi" = "UIUCnet" ];
then # wow your are in campus wifi
echo "Great! You're connected with campus WiFi."
VPNyn="onCampus"
else
echo "Already connected to UIUC's VPN?" yn
read VPNyn
fi
fi
# end CheckWiFi
# connect to VPN
if [ "$VPNyn" = "n" ]||[ "$VPNyn" = "N" ]
then
cd /Applications
if [ -d "Cisco" ];then
echo "open Cisco AnyConnect"
open /Applications/Cisco/Cisco\ AnyConnect\ Secure\ Mobility\ Client.app
sleep 2
else
echo "Please install Cisco AnyConnect first"
open https://www.cites.illinois.edu/vpn/
sleep 2
fi
fi
# end VPN
echo "..."
echo "Network Checking Succeed."
echo "Please enter your netid:"
read yournetid
cd ~
# Mount ece391_Classes&ece391_Team
cd ~
if [ ! -d "ece391_Classes" ]
then # check if the dir exists
mkdir ece391_Classes
echo "Created dir ece391_Classes"
fi
mount -t smbfs "//${yournetid}@instdir05.engr.illinois.edu/classes/ece391" ece391_Classes
echo "Your Shared Volume ece391 is mapped to dir ece391_Classes."
if [ ! -d "ece391_Team" ]
then # check if the dir exists
mkdir ece391_Team
echo "Created dir ece391_Classes"
fi
mount -t smbfs "//${yournetid}@engr-ece-391.engr.illinois.edu/team/ece391/${yournetid}" ece391_Team
echo "Your Shared Volume team/$yournetid is mapped to dir ece391_Team."
# end Mount