-
Notifications
You must be signed in to change notification settings - Fork 1
/
fritzvpn.sh
executable file
·71 lines (51 loc) · 2.35 KB
/
fritzvpn.sh
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
68
69
70
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
mkdir $DIR/tmp
_temp="$DIR/tmp/answer.$$"
cp $DIR/template/template.cfg ./
cp $DIR/template/template.pcf ./
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter the name of the profile" 8 52 2>$_temp
profilename=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter ip or dyndns adress of your FritzBox" 8 52 2>$_temp
host=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter the networkadress of your FritzBox network (192.168.0.0)" 8 52 2>$_temp
networkip=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter the subnetmask of your FritzBox network (255.255.255.0)" 8 52 2>$_temp
subnet=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter the ip you want to have while connected to vpn (192.168.0.121)" 8 52 2>$_temp
desiredip=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter a groupname" 8 52 2>$_temp
groupname=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter a grouppassword(a-zA-Z0-9)" 8 52 2>$_temp
grouppassword=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter your desired username" 8 52 2>$_temp
username=`cat $_temp`
dialog --backtitle "FritzVPN Config Generator"\
--inputbox "Enter the password of your desired user(a-zA-Z0-9)" 8 52 2>$_temp
userpassword=`cat $_temp`
sed -i 's/PROFILENAME/'$profilename'/g' $DIR/template.cfg
sed -i 's/DESIREDIP/'$desiredip'/g' $DIR/template.cfg
sed -i 's/SUBNET/'$subnet'/g' $DIR/template.cfg
sed -i 's/NETWORKIP/'$networkip'/g' $DIR/template.cfg
sed -i 's/GROUPNAME/'$groupname'/g' $DIR/template.cfg
sed -i 's/GROUPKEY/'$grouppassword'/g' $DIR/template.cfg
sed -i 's/USERNAME/'$username/'g' $DIR/template.cfg
sed -i 's/USERPASSWORD/'$userpassword'/g' $DIR/template.cfg
sed -i 's/PROFILENAME/'$profilename'/g' $DIR/template.pcf
sed -i 's/DYNIP/'$host'/g' $DIR/template.pcf
sed -i 's/GROUPNAME/'$groupname'/g' $DIR/template.pcf
sed -i 's/GROUPKEY/'$grouppassword'/g' $DIR/template.pcf
sed -i 's/USERNAME/'$username/'g' $DIR/template.pcf
sed -i 's/USERPASSWORD/'$userpassword'/g' $DIR/template.pcf
mv $DIR/template.pcf $DIR/$profilename.pcf
mv $DIR/template.cfg $DIR/$profilename.cfg
rm -R $DIR/tmp
clear