piknew Posted May 15, 2018 Posted May 15, 2018 Is it possible to make small adjustment into line 109 of /etc/update-motd.d/30-sysinfo file (I made the change myslef, but once packages are upgraded - change is overwritten)? Original line is: if [[ $intf =~ ^[ewr].* ]]; then Changed line would be (please note additional letter "b"): if [[ $intf =~ ^[ewrb].* ]]; then You may see the reason - I guess "bond" is the common prefix when binding ethernet devices: admin@PKSERVER:~$ grep -n ewr /etc/update-motd.d/30-sysinfo 109: if [[ $intf =~ ^[ewrb].* ]]; then admin@PKSERVER:~$ sudo ifconfig bond0 Link encap:Ethernet HWaddr 08:00:00:00:02:10 inet addr:192.168.10.210 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::a00:ff:fe00:210/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:171152 errors:0 dropped:0 overruns:0 frame:0 TX packets:163786 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:59535359 (56.7 MiB) TX bytes:90682136 (86.4 MiB) eth0 Link encap:Ethernet HWaddr 08:00:00:00:02:10 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:171152 errors:0 dropped:0 overruns:0 frame:0 TX packets:163786 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:59535359 (56.7 MiB) TX bytes:90682136 (86.4 MiB) Interrupt:114 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:90328 errors:0 dropped:0 overruns:0 frame:0 TX packets:90328 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:43909407 (41.8 MiB) TX bytes:43909407 (41.8 MiB) wlan0 Link encap:Ethernet HWaddr da:f9:d4:00:43:7b UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
zador.blood.stained Posted May 15, 2018 Posted May 15, 2018 2 hours ago, piknew said: if [[ $intf =~ ^[ewrb].* ]]; then You may see the reason - I guess "bond" is the common prefix when binding ethernet devices This will also include bridge interfaces which are usually named brX, so this regexp may need further rework.
piknew Posted May 19, 2018 Author Posted May 19, 2018 So, basically the way would be explicit list of prefixes: eth, bond, wlan, ra, ... Or explicit list of interfaces.
piknew Posted May 23, 2018 Author Posted May 23, 2018 On 5/19/2018 at 4:39 PM, piknew said: ... Or explicit list of interfaces. Proposal: root@PKSERVER:~# grep -n ewr /etc/update-motd.d/30-sysinfo 109: if [[ $intf =~ ^[ewr].* ]] || (grep $intf /etc/conf.d/30-sysinfo-net-interfaces 1>/dev/null 2>&1); then root@PKSERVER:~# cat /etc/conf.d/30-sysinfo-net-interfaces bond0 root@PKSERVER:~#
piknew Posted May 30, 2018 Author Posted May 30, 2018 On 5/15/2018 at 6:00 PM, zador.blood.stained said: This will also include bridge interfaces which are usually named brX, so this regexp may need further rework. During some experiments with nightly builds I noticed that script 30-sysinfo was updated. However, with additional regexp |^br.* - which will include bridges. Maybe I misunderstood, but I thought br interfaces shall be rather excluded, bond included, shall not they? So far I keep modified copy of script (from "proposal" above) and I am using it after it is overwritten by "upgrade".
vlad59 Posted May 30, 2018 Posted May 30, 2018 I agree br should be excluded (at least for my usecase which involve docker). I remember talking about Zador when he changed it a year ago : https://github.com/armbian/build/commit/2d37a1ec3e5aee5ed6d942a6eb93fdbf20a08413#diff-02317355268e7ae7265db2efbf843d7b I don't know why @Igor changed it. But as it's only a motd I don't care a lot about it.
Igor Posted May 30, 2018 Posted May 30, 2018 27 minutes ago, vlad59 said: I agree br should be excluded (at least for my usecase which involve docker). In the end, we should make this configurable.
vlad59 Posted May 30, 2018 Posted May 30, 2018 2 hours ago, Igor said: In the end, we should make this configurable. Yes .... but something configurable is often more complex to maintain so while motd is kind of important for a guy that installed Armbian for the first time, it's rarely useful for someone that only use SSH with a purpose in mind (I only give a quick look to system load to check for unusual load that's all). It depends on the goal.
Igor Posted May 31, 2018 Posted May 31, 2018 Solved in a simple manner: https://github.com/armbian/build/commit/442ab52d3e821fac5453fb21ec2ab294acb53dfd 1
piknew Posted June 1, 2018 Author Posted June 1, 2018 On 5/31/2018 at 10:22 AM, Igor said: Solved in a simple manner: https://github.com/armbian/build/commit/442ab52d3e821fac5453fb21ec2ab294acb53dfd Thanks. I have tested it with custom entry: SHOW_IP_PATTERN="^[ewr].*|^br.*|^lt.*|^umts.*|^bond.*" Test is successful on: Orange Pi+ 2E Orange Pi+ 2 Orange Pi PC Orange Pi Zero (H2+/512) My config for network is to make binding for network interfaces, so bond0 interface is the valid one.
Recommended Posts