#19578: uci show / regression / output contains single quotes
------------------------+------------------------
  Reporter:  bittorf@…  |      Owner:  developers
      Type:  defect     |     Status:  closed
  Priority:  normal     |  Milestone:
 Component:  packages   |    Version:  Trunk
Resolution:  not_a_bug  |   Keywords:
------------------------+------------------------

Comment (by jow):

 {{{
 is_switch=0

 check_switch() {
   local switchdev
   config_get switchdev "$1" device
   if [ "$switchdev" = switch0 ]; then
     is_switch=1
     return 1
   fi
 }

 config_load network
 config_foreach check_switch switch_vlan

 if [ $is_switch -gt 0 ]; then
   echo "One of the vlans refers to switch0"
 fi
 }}}


 {{{
 used_ip=0
 check_ip="10.10.43.33"

 check_alias() {
   local ipaddr
   config_get ipaddr "$1" ipaddr
   if [ "$ipaddr" = "$2" ]; then
     used_ip=1
     return 1
   fi
 }

 config_load network
 config_foreach check_alias alias "$check_ip"

 if [ $used_ip -gt 0 ]; then
   echo "$check_ip is already configured as alias"
 fi
 }}}

--
Ticket URL: <https://dev.openwrt.org/ticket/19578#comment:3>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to