-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew
45 lines (33 loc) · 1.04 KB
/
new
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
#!/bin/bash
basdir=$(pwd)/
datadir=$basdir"data/"
source "$basdir"include/isroot.sh
source "$basdir"include/export.sh
get_argument_value() {
argument_name="$1"
shift
while [ "$1" ]; do
if [[ "$1" == "$argument_name" ]]; then
echo "$2"
return
fi
shift 2
done
}
if [[ $# -eq 0 ]]; then
source "$basdir"include/help.sh
exit 1
fi
arg1=$(get_argument_value "--domain" "$@") # --domain myhost.com
arg2=$(get_argument_value "--subj" "$@") #--subj IN,Rajthan
arg3=$(get_argument_value "--help_notwrking" "$@") # try ./new.sh without arguments
arg4=$(get_argument_value "--subd" "$@") # optional sub domains --subd 1.d.com,2.d.com
arg5=$(get_argument_value "--contact" "$@") # defulat is webmaster@currentdomain
arg6=$(get_argument_value "--conf" "$@") #to/dir/sites/
source "$basdir"include/arguments.sh
source "$basdir"include/cert_existes.sh
source "$basdir"include/check_httpdConf.sh
source "$basdir"include/genkey.sh
source "$basdir"include/domain.sh
source "$basdir"include/gencsr.sh
source "$basdir"include/tiny.sh