]> WPIA git - nre.git/blobdiff - commonFunctions.bash
add: generate htdocs-archives
[nre.git] / commonFunctions.bash
index 1c1ffb18e7d0a02dd23a77c8e7158b7703e59d95..36ffa19fad613285b80585cc1a3f0f39fe278020 100644 (file)
@@ -30,12 +30,23 @@ caSign(){ # csr,ca,config,start,end
     echo "$start $end"
     pushd $2.ca > /dev/null
     if [[ "$2" == "root" && "$1" == root.* ]]; then
-       signkey="-selfsign"
+        signkey="-selfsign"
     else
-       signkey="-cert key.crt"
+        signkey="-cert key.crt"
     fi
     openssl ca $signkey -keyfile key.key -in "$BASE/$1.csr" -out "$BASE/$1.crt" -batch -config "$BASE/../selfsign.config" -extfile "$BASE/$3" $start $end
     popd > /dev/null
     echo "Signed"
 }
 
+findLibfaketime() {
+    for candidate in /usr/lib/faketime/libfaketime.so.1 /usr/lib/*/faketime/libfaketime.so.1; do
+        if [[ -f "$candidate" ]]; then
+            printf '%s\n' "$candidate"
+            return
+        fi
+    done
+    printf >&2 'error: no libfaketime found\n'
+    exit 1 # unfortunately, this will only exit the $() subshell
+}
+