Script to connect to internet at bootup
Olivier Cailloux
olivier.cailloux at gmail.com
Fri Mar 4 17:36:37 UTC 2011
Thanks for the answer. Just tried it, to no avail.
Le 04/03/2011 03:44, Fajar Priyanto a écrit :
> On Fri, Mar 4, 2011 at 10:18 AM, Olivier Cailloux
> <olivier.cailloux at gmail.com> wrote:
>> fails. Currently I have put the script in /etc/profiles.d/, but it often
>> ends up being run too soon.
> /etc/rc.local is the latest to be run during reboot. You can put it there.
>
I added the following three lines into rc.local (originally untouched,
contained only the usual exit 0 which I left at the end of the file).
echo coucou > /home/olivier/Logiciels/FBL-rc-auth-log.log
curl -d 'admin_id=XXX' -d 'admin_pw=XXX'
http://internet.ciup.fr/web_auth/index.html -o
/home/olivier/Logiciels/FBL-rc-auth-res.log 1>>
/home/olivier/Logiciels/FBL-rc-auth-out.log 2>>
/home/olivier/Logiciels/FBL-rc-auth-err.log
echo fin >> /home/olivier/Logiciels/FBL-rc-auth-log.log
Having deleted the files /home/olivier/Logiciels/FBL-rc*, I reboot.
After the reboot: FBL-rc-auth-out.log is empty. FBL-rc-auth-err.log
contains “curl: (6) Couldn't resolve host 'internet.ciup.fr'”.
FBL-rc-auth-log.log contains only “coucou”, which is pretty strange,
meaning that apparently the script did not complete. FBL-rc-auth-res.log
does not exist.
Running 'bash /etc/rc.profile' from a terminal after the boot is
completed executes the script correctly (output files are set as
expected) and correctly authenticates me.
Olivier
More information about the ubuntu-users
mailing list