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.

27 lines
636 B

  1. #!/bin/sh
  2. . /lib/functions.sh
  3. upgrade_watchcat() {
  4. local cfg="$1"
  5. config_get period "$cfg" period
  6. config_get mode "$cfg" mode
  7. config_get pinghosts "$cfg" pinghosts
  8. config_get forcedelay "$cfg" forcedelay
  9. [ -f "/etc/config/watchcat" ] || touch /etc/config/watchcat
  10. uci_add watchcat watchcat
  11. uci_set watchcat @watchcat[-1] period "$period"
  12. uci_set watchcat @watchcat[-1] mode "$mode"
  13. uci_set watchcat @watchcat[-1] pinghosts "$pinghosts"
  14. uci_set watchcat @watchcat[-1] forcedelay "$forcedelay"
  15. uci_remove system "$cfg"
  16. }
  17. config_load system
  18. config_foreach upgrade_watchcat watchcat
  19. uci_commit watchcat
  20. uci commit system