~txtsd/unbound-cache

44012bfcf4ad69d55921f6744e9eef34cf41b9fb — txtsd 1 year, 9 months ago e143fd1
change: Allow script to be run as unbound too

This is useful if it's being run by a service

Signed-off-by: txtsd <thexerothermicsclerodermoid@gmail.com>
1 files changed, 2 insertions(+), 2 deletions(-)

M unbound-cache.sh
M unbound-cache.sh => unbound-cache.sh +2 -2
@@ 22,8 22,8 @@ usage ()
root_check ()
{
  # shellcheck disable=SC2046
  if [ ! $(id | cut -f1 -d" ") = "uid=0(root)" ]; then
    echo "ERROR: You must be super-user to run this script"
  if [ ! $(id | cut -f2 -d"(" | cut -f1 -d")") = "root" ] || [ ! $(id | cut -f2 -d"(" | cut -f1 -d")") = "unbound" ]; then
    echo "ERROR: You must be root (or unbound) to run this script"
    exit 1
  fi
}