acu rtty config

云水 / 2023-07-17 / 原文

acu rtty config

 

root@ACU:/etc/config# cd /tmp/
root@ACU:/tmp# ls
4g_output                etc                      mulkill_log              shm
IdSrFreq                 extroot                  mulwatch_log             spool
TZ                       gis.log                  nginx_multicast_log.txt  state
WARN_OUTPUT_FILE         hosts                    openamipfile             sysinfo
adc                      lib                      overlay                  timerlog
all_acu_info             lock                     resolv.conf              tmp
auth.sqlite              log                      resolv.conf.auto
dhcp.leases              modem_system_code        rtty_deploy.tar.gz
dnsmasq.d                modemfile                run
root@ACU:/tmp# 
root@ACU:/tmp# tar -zxvpf rtty_deploy.tar.gz -C /
etc/rc.local
etc/config/root/
etc/config/root/etc/
etc/config/root/etc/config/
etc/config/root/etc/config/rtty
etc/config/root/etc/init.d/
etc/config/root/etc/init.d/rtty
etc/config/root/usr/
etc/config/root/usr/lib/
etc/config/root/usr/lib/libev.so.4
etc/config/root/usr/lib/libev.so.4.0.0
etc/config/root/usr/lib/libev.so
etc/config/root/usr/sbin/
etc/config/root/usr/sbin/rtty
etc/config/root/usr/sbin/tree
root@ACU:/tmp# 
root@ACU:/tmp# cat /etc/rc.local 
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

[ -d "/etc/config/root" ] && cp -af /etc/config/root/* / && echo "copy file ..."
[ -f "/etc/init.d/rtty" ] && /etc/init.d/rtty start && echo "rtty start ..."

exit 0
root@ACU:/tmp# 
root@ACU:/tmp# [ -d "/etc/config/root" ] && cp -af /etc/config/root/* / && echo "copy file ..."
copy file ...
root@ACU:/tmp# 
root@ACU:/tmp# tree /etc/config/root/
/etc/config/root/
├── etc
│   ├── config
│   │   └── rtty
│   └── init.d
│       └── rtty
└── usr
    ├── lib
    │   ├── libev.so -> libev.so.4.0.0
    │   ├── libev.so.4 -> libev.so.4.0.0
    │   └── libev.so.4.0.0
    └── sbin
        ├── rtty
        └── tree

6 directories, 7 files
root@ACU:/tmp# 
root@ACU:/tmp# route 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.120.129 0.0.0.0         UG    0      0        0 eth0.3074
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.120.128 *               255.255.255.128 U     0      0        0 eth0.3074
192.192.192.0   *               255.255.255.0   U     0      0        0 eth0
root@ACU:/tmp# 
root@ACU:/tmp# cat /etc/config/network
config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd4f:49c1:1bdf::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1'
	option _orig_ifname 'eth1'
	option _orig_bridge 'true'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '3072'
	option ports '0 1 2 3 4'

config interface 'wan3074'
	option ifname 'eth0.3074'
	option _orig_ifname 'eth0.3074'
	option _orig_bridge 'false'
	option proto 'static'
	option ipaddr '192.168.120.130'
	option netmask '255.255.255.128'
	option gateway '192.168.120.129'
	option dns '223.5.5.5'

root@ACU:/tmp# 
root@ACU:/tmp# 
root@ACU:/tmp# route -n | grep "0.0.0.0.*0.0.0.0" | awk '{print $8}'
eth0.3074
root@ACU:/tmp# 
root@ACU:/tmp# uci set rtty.@rtty[0].ifname="$(route -n | grep "0.0.0.0.*0.0.0.0" | awk '{print $8}')"
root@ACU:/tmp# 
root@ACU:/tmp# uci set rtty.@rtty[0].id="WH_SJWX_demo_001"
root@ACU:/tmp# 
root@ACU:/tmp# uci commit rtty
root@ACU:/tmp# 
root@ACU:/tmp# uci show rtty
rtty.@rtty[0]=rtty
rtty.@rtty[0].host='10.0.8.151'
rtty.@rtty[0].port='5912'
rtty.@rtty[0].ifname='eth0.3074'
rtty.@rtty[0].id='WH_SJWX_demo_001'
root@ACU:/tmp# 
root@ACU:/tmp# 
root@ACU:/tmp# /etc/init.d/rtty stop
Killed
root@ACU:/tmp# 
root@ACU:/tmp# /etc/init.d/rtty start
rtty service has started.
root@ACU:/tmp# 
root@ACU:/tmp# 

 

rttys - http://10.0.8.151:5913/

 

=========== End