Pi-hole_in_High_Availability/gemini_chk

13 lines
363 B
Text
Raw Permalink Normal View History

2022-10-16 12:53:51 +00:00
#!/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