Browse Source

fix add certs 25.04.23:21.53

Valery 1 year ago
parent
commit
c7b666af6a
1 changed files with 7 additions and 26 deletions
  1. 7 26
      rus_mfc-add_deb

+ 7 - 26
rus_mfc-add_deb

@@ -13,9 +13,13 @@ cert_gov=( "russian_trusted_sub_ca_pem.crt"
13 13
 	);
14 14
 
15 15
 # certs pool
16
-path_ssl="/etc/ssl/certs";
16
+path_ssl="/usr/local/share/ca-certificates/russian_trusted";
17 17
 
18 18
 function addCerts(){
19
+if [ ! -d "$path_ssl" ]; then
20
+  sudo mkdir -p $path_ssl;
21
+fi
22
+
19 23
 for ((ix = 0; ix != ${#cert_gov[@]}; ix++)); do
20 24
     if wget -c -t 1 --inet4-only  -c -O $path_script/${cert_gov[$ix]} $url_gov/${cert_gov[$ix]}; then
21 25
 	    echo "сертификат скачан успешно!";
@@ -24,33 +28,10 @@ for ((ix = 0; ix != ${#cert_gov[@]}; ix++)); do
24 28
 	    exit
25 29
     fi
26 30
     if [ "$( echo -e ${cert_gov[$ix]}|wc -m)" != "0" ]; then
27
-      cert_name=$(echo -e ${cert_gov[$ix]}|sed 's/\_pem.crt//g');
28
-      sudo openssl x509 -in $path_script/${cert_gov[$ix]} -out $path_ssl/$cert_name.pem -outform PEM;
29
-      cd $path_ssl;
30
-      sudo ln -sf $cert_name.pem $(sudo openssl x509 -in $cert_name.pem -noout -hash).0
31
-            sudo chmod 600 $path_ssl/$cert_name.pem;
32
-      sudo chown root:root $path_ssl/$cert_name.pem;
33
-      cd $path_script;
34
-    fi
35
-    # для пользователя 
36
-    eval cert8_db="(" $(find $HOME -type f -name cert8.db -printf '%p\n') ")";
37
-    eval cert9_db="(" $(find $HOME -type f -name cert9.db -printf '%p\n') ")";
38
-#
39
-    if [ "$(echo -e ${#cert8_db[@]})" != "0" ]; then
40
-      for ((i_dm = 0; i_dm != ${#cert8_db[@]}; i_dm++)); do
41
-          certdir=$(dirname ${cert8_db[$i_dm]});
42
-          sudo certutil -A -n "$cert_name" -t "TCu,Cu,Tu" -i $path_script/${cert_gov[$ix]} -d dbm:$certdir;
43
-      done
44
-    fi
45
-    if [ "$(echo -e ${#cert9_db[@]})" != "0" ]; then
46
-      for ((i_dm = 0; i_dm != ${#cert9_db[@]}; i_dm++)); do
47
-          certdir=$(dirname ${cert9_db[$i_dm]});
48
-          sudo certutil -A -n "$cert_name" -t "TCu,Cu,Tu" -i $path_script/${cert_gov[$ix]} -d sql:$certdir
49
-      done
31
+      sudo cp -f $path_script/${cert_gov[$ix]} $path_ssl/${cert_gov[$ix]}
50 32
     fi
51 33
 done
52
-sudo update-ca-certificates;
53
-sudo update-ca-certificates --fresh;
34
+sudo update-ca-certificates -v;
54 35
 #
55 36
 }
56 37