|
@@ -24,11 +24,15 @@ opt=$2;
|
24
|
24
|
|
25
|
25
|
#--@F Get info area
|
26
|
26
|
function getInfo() {
|
27
|
|
-if [ $opt = "apache" ];then
|
28
|
|
- find $sites_apache/* -maxdepth 0 -type l -printf '%f\n' 2>$tmp_dir/active_sites.inf;
|
|
27
|
+if [ ! -d $tmp_dir ]; then
|
|
28
|
+ mkdir -p $tmp_dir;
|
29
|
29
|
fi
|
30
|
|
-if [ $opt = "nginx" ];then
|
31
|
|
- find $sites_nginx/* -maxdepth 0 -type l -printf '%f\n' 2>$tmp_dir/active_sites.inf;
|
|
30
|
+
|
|
31
|
+if [[ $opt != "nginx" ]] || [[ "$opt" == "apache" ]]; then
|
|
32
|
+ find $sites_apache/* -maxdepth 0 -type l -printf '%f\n' >$tmp_dir/active_sites.inf;
|
|
33
|
+fi
|
|
34
|
+if [[ $opt != "apache" ]] || [[ "$opt" == "nginx" ]]; then
|
|
35
|
+ find $sites_nginx/* -maxdepth 0 -type l -printf '%f\n' >$tmp_dir/active_sites.inf;
|
32
|
36
|
fi
|
33
|
37
|
}
|
34
|
38
|
|
|
@@ -282,7 +286,12 @@ fi
|
282
|
286
|
|
283
|
287
|
## update cert
|
284
|
288
|
"--test" | "--test" )
|
285
|
|
-getInfo;
|
|
289
|
+if [ "$opt" != "" ]; then
|
|
290
|
+ getInfo;
|
|
291
|
+else
|
|
292
|
+ echo "no parameter specified - nginx or apache?"
|
|
293
|
+ echo "avtocertbot.sh --test apache"
|
|
294
|
+fi
|
286
|
295
|
|
287
|
296
|
;;
|
288
|
297
|
|