]> git.armaanb.net Git - asd-repo.git/blobdiff - core/libressl/files/update-certdata.sh
libressl: skip updating cert if not root
[asd-repo.git] / core / libressl / files / update-certdata.sh
index 6db69c7eacd4995c95c85a39bd9ac61b6fbc1572..2901c7b41ff3a3ded41402e3bb5cbbec1906b562 100755 (executable)
@@ -1,7 +1,11 @@
 #!/bin/sh -e
 
-cd /etc/ssl && {
-    curl -LO https://curl.haxx.se/ca/cacert.pem
-    mv -f cacert.pem cert.pem
-    printf '%s\n' "${0##*/}: updated cert.pem"
-}
+if [ -w /etc/ssl/cacert.pem ]; then
+    cd /etc/ssl && {
+        curl -LO https://curl.haxx.se/ca/cacert.pem
+        mv -f cacert.pem cert.pem
+        printf '%s\n' "${0##*/}: updated cert.pem"
+    }
+else
+    printf "Skipping updating certdata as /etc/ssl/cacert.pem is not writable\n"
+fi