瀏覽代碼

Create gemini_chk

kodlz 2 年之前
父節點
當前提交
cb8e50f290
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      gemini_chk

+ 12 - 0
gemini_chk

@@ -0,0 +1,12 @@
+#!/bin/bash
+# make sure the pihole-gemini script is being run by gravity.sh
+
+GEMINI='su -c /usr/local/bin/pihole-gemini - <gemini user>'
+GRAVITY=/opt/pihole/gravity.sh
+
+TRIGGER=$(sed -e '$!{h;d;}' -e x $GRAVITY)
+if [ "$TRIGGER" != "$GEMINI" ]
+then
+        # insert the gemini commandline before the last line of the script
+        sed -i "$ i$GEMINI" $GRAVITY
+fi