You are not logged in.
I want to make a daemon that when I start my computer and my router is not already available, to auto connect to my router when it becomes available later without rebooting
So I thought in making a script and running it as a daemon which will hopefully solve my problems. The thing is I'm having a hard time isolating only the routers ip address. Here's how I thought the script should look like
#!/bin/sh
anet="$(ifconfig | awk "/router_address/{print $field}")"
if [ $anet = "router_address" ]
then
/etc/rc.d/network restart
fi
But although awk isolates the line with my router address it doesn't recognizes any field. Any value I assume to $field doesn't isolates anything so I could guess the right field (or fields) for the router's ip address.
Last edited by I'mGeorge (2011-03-31 09:46:05)
I've first installed Arch in March
Offline
Not a direct answer to your question, but have you considered using Netcfg for this? https://wiki.archlinux.org/index.php/Netcfg
ᶘ ᵒᴥᵒᶅ
Offline
Not a direct answer to your question, but have you considered using Netcfg for this? https://wiki.archlinux.org/index.php/Netcfg
thx a bunch, all I needed was ifplugd daemon. That script I thought about was a bad idea anyway 'cause continuous starting or restarting your network can't be good so I had to work more on it while ifplugd made everything happen clean and easily.
I've first installed Arch in March
Offline
Good to hear I'mGeorge, please mark your thread solved by prepending it to the topic title.
ᶘ ᵒᴥᵒᶅ
Offline