]> git.proxmox.com Git - proxmox-acme.git/blobdiff - src/test/check-missing-functions
move check-missing-function script to tests
[proxmox-acme.git] / src / test / check-missing-functions
diff --git a/src/test/check-missing-functions b/src/test/check-missing-functions
new file mode 100755 (executable)
index 0000000..c8a2b3d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+# functions already in src/proxmox-acme
+PRESENT=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
+       ../proxmox-acme | sed -r 's/\|$//')
+
+# functions defined in all plugins
+LOCAL=$(awk 'BEGIN{ORS="|";} /^_/{ gsub(/\(\) {/, ""); print $0}' \
+       ../acme.sh/dnsapi/dns*.sh | sed -r 's/\|$//')
+
+grep -P '\b_[a-zA-Z0-9_-]+ ' ../acme.sh/dnsapi/dns_*sh | \
+       grep -Ev "$PRESENT|$LOCAL|\b_[a-zA-Z0-9_-]+=|^../acme.sh/dnsapi/.*sh: *#"