basmeerman / unifi-usg-kpn

Unifi USG Configuration for use with KPN
164 stars 37 forks source link

Issues with update script #16

Closed ScottGuymer closed 5 years ago

ScottGuymer commented 5 years ago

I spent some time implementing this yesterday and ran into some issues with the udpate script

I found that i had to re-order the commands so that configure was run first to enter the mode and then the other commands..

i ended up with

#!/bin/vbash

source /opt/vyatta/etc/functions/script-template

configure

r_ip=$(run show dhcp client leases | grep router | awk '{ print $3 }');
iptv_static=$(echo "set protocols static route 213.75.112.0/21 next-hop $r_ip")

delete protocols static route 213.75.112.0/21

eval $iptv_static

commit
save
exit

Not sure if this is as a result of OS changes on the router or if its the fact i am using the smaller 3 port router.

Happy to open a PR if you think its worthwhile.

basmeerman commented 5 years ago

Scott thanks for the contribution. I merged your PR. Kind regards.