Przeglądaj źródła

add systemd to letsencrypt installer (#8289)

* add systemd to letsencrypt

* Better readability of systemd change

Co-authored-by: Sebastian Feustel <sebastian.feustel@aei.mpg.de>
j8
53845714nF 4 lat temu
rodzic
commit
f82088fb8f
No account linked to committer's email address
1 zmienionych plików z 19 dodań i 6 usunięć
  1. 19
    6
      resources/install-letsencrypt-cert.sh

+ 19
- 6
resources/install-letsencrypt-cert.sh Wyświetl plik

95
     CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
95
     CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
96
     sed -i "s/ssl_certificate\ \/etc\/jitsi\/meet\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
96
     sed -i "s/ssl_certificate\ \/etc\/jitsi\/meet\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
97
         $CONF_FILE
97
         $CONF_FILE
98
-
99
-    echo "service nginx reload" >> $CRON_FILE
100
-    service nginx reload
98
+    
99
+    if type service >/dev/null 2>&1
100
+    then 
101
+        service nginx reload
102
+        echo "service nginx reload" >> $CRON_FILE
103
+    else 
104
+        systemctl reload nginx.service 
105
+        echo "systemctl reload nginx.service" >> $CRON_FILE
106
+    fi
107
+    
101
 elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
108
 elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
102
 
109
 
103
     /usr/bin/certbot certonly --noninteractive \
110
     /usr/bin/certbot certonly --noninteractive \
116
     CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
123
     CERT_CRT_ESC=$(echo $CERT_CRT_ESC | sed 's/\//\\\//g')
117
     sed -i "s/SSLCertificateFile\ \/etc\/jitsi\/meet\/.*crt/SSLCertificateFile\ $CERT_CRT_ESC/g" \
124
     sed -i "s/SSLCertificateFile\ \/etc\/jitsi\/meet\/.*crt/SSLCertificateFile\ $CERT_CRT_ESC/g" \
118
         $CONF_FILE
125
         $CONF_FILE
119
-
120
-    echo "service apache2 reload" >> $CRON_FILE
121
-    service apache2 reload
126
+    
127
+    if type service >/dev/null 2>&1
128
+    then 
129
+        service apache2 reload
130
+        echo "service apache2 reload" >> $CRON_FILE
131
+    else 
132
+        systemctl reload apache2.service 
133
+        echo "systemctl reload apache2.service" >> $CRON_FILE
134
+    fi
122
 fi
135
 fi
123
 
136
 
124
 # the cron file that will renew certificates
137
 # the cron file that will renew certificates

Ładowanie…
Anuluj
Zapisz