|
1 #!/bin/sh |
|
2 |
|
3 #################################################################################################################### |
|
4 # |
|
5 # Global Variables |
|
6 # |
|
7 #################################################################################################################### |
|
8 last_path=""; |
|
9 |
|
10 |
|
11 #################################################################################################################### |
|
12 # |
|
13 # GetPath |
|
14 # |
|
15 # $1 - Name of thing to get the path of |
|
16 # $2 - Default path |
|
17 # |
|
18 # Places pathname in last_path global var |
|
19 # |
|
20 #################################################################################################################### |
|
21 GetPath() |
|
22 { |
|
23 # Ask for the path |
|
24 echo -n "Enter the path for" $1 "["$2"]: "; |
|
25 read answer rubbish; |
|
26 |
|
27 # If the string is empty then replace with the default path |
|
28 if test -z $answer; then |
|
29 last_path=$2; |
|
30 else |
|
31 last_path=$answer; |
|
32 fi |
|
33 |
|
34 # Done |
|
35 } |
|
36 |
|
37 |
|
38 #################################################################################################################### |
|
39 # |
|
40 # Ask |
|
41 # |
|
42 # $1 = Question string. |
|
43 # |
|
44 # Returns 1 for yes 0 for no |
|
45 # |
|
46 #################################################################################################################### |
|
47 Ask() |
|
48 { |
|
49 echo -n $1 "[yes / no] "; |
|
50 read answer rubbish; |
|
51 if [ $answer = "yes" ]; then |
|
52 return 1; |
|
53 else |
|
54 return 0; |
|
55 fi |
|
56 } |
|
57 |
|
58 |
|
59 |
|
60 #################################################################################################################### |
|
61 # |
|
62 # MAIN(): |
|
63 # |
|
64 #################################################################################################################### |
|
65 |
|
66 |
|
67 #################################################################################################################### |
|
68 # |
|
69 # (1) Print info |
|
70 # |
|
71 #################################################################################################################### |
|
72 clear |
|
73 echo -------------------------------------------------------------------------------------------------------------- |
|
74 echo |
|
75 echo " Emulation Environment setup for the Network Emulator " |
|
76 echo |
|
77 echo -------------------------------------------------------------------------------------------------------------- |
|
78 |
|
79 |
|
80 #################################################################################################################### |
|
81 # |
|
82 # (2) Get path information |
|
83 # |
|
84 #################################################################################################################### |
|
85 GetPath "pppd" "/usr/sbin/pppd" |
|
86 pppd_path=$last_path; |
|
87 GetPath "the dynamics agents" "/home/penuser/dynamics/sbin/" |
|
88 dynamics_sbin_path=$last_path; |
|
89 echo -------------------------------------------------------------------------------------------------------------- |
|
90 |
|
91 |
|
92 #################################################################################################################### |
|
93 # |
|
94 # (3) Setup the symlinks |
|
95 # |
|
96 #################################################################################################################### |
|
97 ln -v -f -s $pppd_path ../bin/pppd |
|
98 |
|
99 ln -v -f -s $dynamics_sbin_path/dynmn_tool ../bin/dynmn_tool |
|
100 ln -v -f -s $dynamics_sbin_path/dynfa_tool ../bin/dynfa_tool |
|
101 ln -v -f -s $dynamics_sbin_path/dynha_tool ../bin/dynha_tool |
|
102 |
|
103 ln -v -f -s $dynamics_sbin_path/dynmnd ../bin/dynmnd |
|
104 ln -v -f -s $dynamics_sbin_path/dynfad ../bin/dynfad |
|
105 ln -v -f -s $dynamics_sbin_path/dynhad ../bin/dynhad |
|
106 |
|
107 ln -v -f -s ../ConfigurationFiles/dynmnd.ref_template.conf ../bin/dynmnd.template.conf |
|
108 ln -v -f -s ../ConfigurationFiles/dynhad.ref_template.conf ../bin/dynhad.template.conf |
|
109 ln -v -f -s ../ConfigurationFiles/dynfad.ref_template.conf ../bin/dynfad.template.conf |
|
110 |
|
111 ln -v -f -s $dynamics_sbin_path/../etc/dynfad.key ../bin/dynfad.key |
|
112 |
|
113 echo -------------------------------------------------------------------------------------------------------------- |
|
114 |
|
115 |
|
116 #################################################################################################################### |
|
117 # |
|
118 # Done |
|
119 # |
|
120 #################################################################################################################### |
|
121 echo " Setup successful" |
|
122 echo -------------------------------------------------------------------------------------------------------------- |