Shell Scripting
i have a program which my ISP has provided me to authenticate myself so that i can use the web.
It is called 24 online Client. so i type ./24onlineClient -u [username] then it says Password: the i type the password and then it authenticates me I would like it to logon automatically every time i start my pc. so i wrote a shell script and put this command in and i plan to put it in rc.local or something. But i have still not figured out how to provide this program with the password so that it automatically logs in without asking me for the password. i tried ./24onlineclient -u [username] < pass.txt and stored the password in pass.txt but it still asks for the password. So any idea how i can get this done. I am a newbie, so please dont use complicated terms. |
I don't know if this would work or not, because I can't really test it without that script, and even if I did have it I wouldn't be able to since I wouldn't authenticate with your ISP, but I'll give ya something to start with as a shot in the dark :
Code:
#!/bin/bash What I would try instead of keeping on rebooting, is just fill in your username and password above in the script, and just run the script and see if your online. |
Hey i typed in that script but it still asks me for the password. I suppose that pipe is as good as a redirect
< symbol which is also not working. If you want to test it out, the client is available at http://prdownload.berlios.de/cyberoa...x86-1.0.tar.gz of course you wont get authenticated but all you have to check is that whether it prompts for the password or not. Just enter any 24online online server. It will probably work. |
If you don't get a real solution, I can describe a MONUMENTAL hack to accomplish this, using Gnu screen, and stuffing characters into it from a shell script. It's a bit complicated, so I'll hold off until a time of last resort.
--- rod. |
Hi... there is an alternative soultion.. I dont know how to get ure password into the script but u can get the alternate cyberoam client. There are a couple of alternatives to Cyberoams 24Online... you can google for them.. One which i used was Slyberoam.
P.S. u can also try linc-daemon sourceforge.net/project/showfiles.php?group_id=55535 Hope it helpss |
there is an option -f that will write a config file for you. Try to play around with that file, I saw there are couple of options about password. Save password and password fields might be your solution
|
i am not interested in the client.
I am interested in the shell scripting part. So even if the client provides any option it does not matter. I want to know how to supply the password via shell script. |
i am not interested in the client.
I am interested in the shell scripting part. So even if the client provides any option it does not matter. I want to know how to supply the password via shell script. please help. |
sorry for the double post. I think cyberoam has an option of auto login.
But there must be some way to do it by shell scripting. hey thenbomr, i dont mind that solution of course, if you can explain it of course. |
I would also try this:
Code:
#!/bin/bash I have tried the same trick in the past using a Qt/C++ program that tricks /usr/bin/sudo and passes it the root password to install rpm files. Here is part of the code: Code:
QString password; |
It looks like the dialog to accept the login parameters is not reading from stdin, so no amount of stdio redirection is going to work. Another tack must be taken.
One method is to run the program inside of a gnu screen session. Screen allows one to 'stuff' characters into its console/tty input at a bit lower level, so we can 'type' into things that aren't reading stdin. Code:
#!/bin/sh The above is a modification of a method I use for launching an application at boot time. The session will run as root, since it is run from rc.local. You may be able to use 'su' to change the user id when launching either screen or your 24 Online client. In order to access the running session, you can re-attach to the screen session with Code:
screen -S "24 Online" -x Code:
screen -S "root/24 Online" -x Code:
multiuser on You can test things using a normal shell script, and once the wrinkles are ironed out, put it into rc.local I suggest reading up on gnu screen, a priori. Note also the inherent insecurity of embedding a password into a plaintext file. Caveat emptor. I told you this was a monumental hack, did I not? Enjoy. --- rod. |
All times are GMT -5. The time now is 02:58 PM. |