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.

20 lines
405 B

  1. #!/bin/sh
  2. # check if wireguard
  3. if [ "${DEVTYPE}" != "wireguard" ]; then
  4. exit 0
  5. fi
  6. # check if correct naming
  7. slicedint=$(echo "$INTERFACE" | cut -c1-3)
  8. if [ "${slicedint}" != "wg_" ]; then
  9. exit 0
  10. fi
  11. if [ "${ACTION}" = "add" ]; then
  12. ubus call olsrd add_interface '{"ifname":'\""$INTERFACE"\"'}'
  13. fi
  14. if [ "${ACTION}" = "remove" ]; then
  15. ubus call olsrd del_interface '{"ifname":'\""$INTERFACE"\"'}'
  16. fi