On Wed, Jul 6, 2016 at 10:02 AM, Michael D. Setzer II <[email protected]> wrote: > Did further testing, and the output has definitely changed to going to > Standard Error instead of Standard Out. > > Running my current image under VirtualBox with busybox 124.2 > > udhcpc -n -t 8 -T 5 i eth0 -s /udcpc.sh >out1 2>out2 > > out1 contains following > > udhcpc (v1.24.2) started > Sending discover... > Sending select for 192.168.128.101... > Lease of 192.168.128.101 obtained, lease time 43200 > > out2 contains nothing. > > Copied a build of the 1.25.0 busybox and did same command. > > ./busybox125 udhcpc -n -t 8 -T 5 i eth0 -s /udcpc.sh >out1a 2>out2a > > out1a contains nothing?? > > out2a contains > > udhcpc: started, v1.25.0 > udhcpc: sending discover > udhcpc: sending select for 192.168.128.101 > udhcpc: lease of 192.168.128.101 obtained, lease time 43200 > > So, the change is actually causing three issues > Original line in script is like this > ipaddress=`udhcpc -n -i $device -s./udhcpc.sh | grep Lease | cut -d\ -f3 | > tr > -d "\n"` > > 1. Output needs to be switched from stderr to stdout using 2>&1 > 2. Since the case of the word I selected to use to select line is changed, > either case needs to be changed or -i used with grep. > 3. With the additional field added to the output, the -f3 has to be changed to > -f4
Sorry for the inconvenience this change is causing you. Instead of scraping output, it's possible to use environment variables in udhcpc.sh - that is how DHCP information is supposed to be accessed. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
