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 4
 # license: GPL 2.0
5 5
 # create 2022
6 6
 #
7
-version="0.3.2";
7
+version="0.3.3";
8 8
 sname="avto4certbot";
9 9
 # необходимы для работы: nginx,certbot (и если почтовый сервер то сервисы в restartMail)
10 10
 # create new cert or update
@@ -18,7 +18,8 @@ source "$path_script/avto4certbot.conf";
18 18
 nginx_enable="/etc/nginx/sites-enabled";
19 19
 nginx_available="/etc/nginx/sites-available";
20 20
 ## - mail services
21
-mailservice=(
21
+set_service=(
22
+    ##"gogs"
22 23
     "dbmail"
23 24
     "postfix"
24 25
     "stunnel4"
@@ -239,11 +240,11 @@ fi
239 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 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 248
 done
248 249
 }
249 250
 
@@ -258,8 +259,8 @@ upSite;
258 259
 createCert;
259 260
 toSSL;
260 261
 downSite;
261
-if [ "$opt" == "mail" ]; then
262
-restartMail;
262
+if [ "$opt" == "srv" ]; then
263
+restartService;
263 264
 else
264 265
 restoreSite;
265 266
 fi
@@ -274,8 +275,8 @@ upSite;
274 275
 renew;
275 276
 toSSL;
276 277
 downSite;
277
-if [ "$opt" == "mail" ]; then
278
-restartMail;
278
+if [ "$opt" == "srv" ]; then
279
+restartService;
279 280
 else
280 281
 restoreSite;
281 282
 fi
@@ -286,8 +287,8 @@ fi
286 287
 ## update cert force
287 288
 "--flist" | "--flist" )
288 289
 toSSL;
289
-if [ "$opt" == "mail" ]; then
290
-restartMail;
290
+if [ "$opt" == "srv" ]; then
291
+restartService;
291 292
 fi
292 293
 
293 294
 ;;
@@ -297,9 +298,9 @@ fi
297 298
 * )
298 299
 checkDep;
299 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 305
 esac
305 306