I need to store the current IP adress of my Raspberry Pi into a file. Can someone tell me how to do this?
The goal is to create a file in /var/www/ipadress.txt
with this content:
192.168.0.28
$ ifconfig
eth0 Link encap:Ethernet Hardware Adresse b8:27:eb:7c:ce:18
inet Adresse:192.168.0.28 Bcast:192.168.0.255 Maske:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX packets:1762 errors:0 dropped:0 overruns:0 frame:0
TX packets:1044 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:267534 (261.2 KiB) TX bytes:233261 (227.7 KiB)
I need the part: 192.168.0.28