You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
676 B

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
  4. # This is free software, licensed under the MIT License
  5. #
  6. . /lib/functions.sh
  7. update() {
  8. config_get_bool enabled $1 enabled 0
  9. config_get mode $1 mode default
  10. if [ ! -f /etc/safe-search/available/$1.$mode ]; then
  11. echo Error: /etc/safe-search/available/$1.$mode does not exist. Please check your configuration in /etc/config/safe-search
  12. else
  13. if [ "$enabled" -eq 1 ]; then
  14. ln -s /etc/safe-search/available/$1.$mode /etc/safe-search/enabled/
  15. fi
  16. fi
  17. }
  18. rm -f /etc/safe-search/enabled/*
  19. config_load 'safe-search'
  20. config_foreach update safe-search
  21. /etc/init.d/dnsmasq reload