We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76a46e0 commit f4f1c0bCopy full SHA for f4f1c0b
utils/certmanager.sh
@@ -12,11 +12,6 @@ for sudo_cmd in "kdesu" "gksu" "pkexec"; do
12
fi
13
done
14
15
-cmd_exists () {
16
- type "$1" &> /dev/null;
17
-}
18
-
19
20
export PATH=$PATH:/sbin/
21
if cmd_exists update-ca-certificates; then
22
ca_path=/usr/local/share/ca-certificates/
@@ -37,8 +32,18 @@ $su_graph $ca_update_cmd
37
32
#Alway run install, it does not hurt
38
33
39
34
if cmd_exists apt-get; then
35
+ DBDIR="$HOME/.pki/nssdb"
40
36
$su_graph apt-get install libnss3-tools
41
- certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n Arduino -i $1
+
+ # if the dir does not exists, created the cert db
+ stat $DBDIR
+ if [ "$?" -ne "0" ]; then
+ mkdir -p $DBDIR
42
+ certutil -d sql:$DBDIR -N
43
+ fi
44
45
+ certutil -d sql:$DBDIR -A -t "C,," -n Arduino -i $1
46
47
exit $?
48
49
0 commit comments