Browse Source

add others restarts 16.06.23

root 1 year ago
parent
commit
095c780043
1 changed files with 16 additions and 15 deletions
  1. 16 15
      avto4certbot/avto4certbot.sh

+ 16 - 15
avto4certbot/avto4certbot.sh

@@ -4,7 +4,7 @@
4
 # license: GPL 2.0
4
 # license: GPL 2.0
5
 # create 2022
5
 # create 2022
6
 #
6
 #
7
-version="0.3.2";
7
+version="0.3.3";
8
 sname="avto4certbot";
8
 sname="avto4certbot";
9
 # необходимы для работы: nginx,certbot (и если почтовый сервер то сервисы в restartMail)
9
 # необходимы для работы: nginx,certbot (и если почтовый сервер то сервисы в restartMail)
10
 # create new cert or update
10
 # create new cert or update
@@ -18,7 +18,8 @@ source "$path_script/avto4certbot.conf";
18
 nginx_enable="/etc/nginx/sites-enabled";
18
 nginx_enable="/etc/nginx/sites-enabled";
19
 nginx_available="/etc/nginx/sites-available";
19
 nginx_available="/etc/nginx/sites-available";
20
 ## - mail services
20
 ## - mail services
21
-mailservice=(
21
+set_service=(
22
+    ##"gogs"
22
     "dbmail"
23
     "dbmail"
23
     "postfix"
24
     "postfix"
24
     "stunnel4"
25
     "stunnel4"
@@ -239,11 +240,11 @@ fi
239
 ln -s $path_tmp/$sitename.conf $nginx_enable/$sitename.conf
240
 ln -s $path_tmp/$sitename.conf $nginx_enable/$sitename.conf
240
 }
241
 }
241
 
242
 
242
-function restartMail(){
243
-for ((scn=0; scn != ${#mailservice[@]}; scn++))
243
+function restartService(){
244
+for ((scn=0; scn != ${#set_service[@]}; scn++))
244
     do
245
     do
245
-/etc/init.d/${mailservice[$scn]} restart;
246
-# systemctl restart ${mailservices[$scn]};
246
+/etc/init.d/${set_service[$scn]} restart;
247
+# systemctl restart ${set_services[$scn]};
247
 done
248
 done
248
 }
249
 }
249
 
250
 
@@ -258,8 +259,8 @@ upSite;
258
 createCert;
259
 createCert;
259
 toSSL;
260
 toSSL;
260
 downSite;
261
 downSite;
261
-if [ "$opt" == "mail" ]; then
262
-restartMail;
262
+if [ "$opt" == "srv" ]; then
263
+restartService;
263
 else
264
 else
264
 restoreSite;
265
 restoreSite;
265
 fi
266
 fi
@@ -274,8 +275,8 @@ upSite;
274
 renew;
275
 renew;
275
 toSSL;
276
 toSSL;
276
 downSite;
277
 downSite;
277
-if [ "$opt" == "mail" ]; then
278
-restartMail;
278
+if [ "$opt" == "srv" ]; then
279
+restartService;
279
 else
280
 else
280
 restoreSite;
281
 restoreSite;
281
 fi
282
 fi
@@ -286,8 +287,8 @@ fi
286
 ## update cert force
287
 ## update cert force
287
 "--flist" | "--flist" )
288
 "--flist" | "--flist" )
288
 toSSL;
289
 toSSL;
289
-if [ "$opt" == "mail" ]; then
290
-restartMail;
290
+if [ "$opt" == "srv" ]; then
291
+restartService;
291
 fi
292
 fi
292
 
293
 
293
 ;;
294
 ;;
@@ -297,9 +298,9 @@ fi
297
 * )
298
 * )
298
 checkDep;
299
 checkDep;
299
 echo "please input pameters: avto4certbot.sh --create | --update | --flist";
300
 echo "please input pameters: avto4certbot.sh --create | --update | --flist";
300
-echo "avto4certbot.sh --create; create new certificate or --create mail; create and restart mail services " 
301
-echo "avto4certbot.sh --update; update certificates or --update mail; update and restart mail services;"
302
-echo "avto4certbot.sh --flist; update certificates from ssl or --flist mail; update certs and restart mail services;"
301
+echo "avto4certbot.sh --create; create new certificate or --create srv; create and restart mail or other  services " 
302
+echo "avto4certbot.sh --update; update certificates or --update srv; update and restart mail or others services;"
303
+echo "avto4certbot.sh --flist; update certificates from ssl or --flist srv; update certs and restart mail or other services;"
303
 ;;
304
 ;;
304
 esac
305
 esac
305
 
306