[opensuse] Running spec. commands on various dial-up providers.
Hi, [SUSE 8.2; user-controlled (kinternet) modem dial-up.] A friend asked for my help, but this time having no access to any SUSE systems with dial-up would make it difficult for me to answer (&test) this. He would like to put a bash-script in /etc/ppp/if-up.d/ to run it everytime he dials any of his few providers and it supposed to do the following: if provider1 has been called, do something, if provider2 has been called, do something else. The only point we are missing here is to know how to get the name of the "active" provider smpppd is using, somehow via the command line. Any idea please? Thanks. Pelibali -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
pelibali wrote:
Hi,
[SUSE 8.2; user-controlled (kinternet) modem dial-up.]
A friend asked for my help, but this time having no access to any SUSE systems with dial-up would make it difficult for me to answer (&test) this. He would like to put a bash-script in /etc/ppp/if-up.d/ to run it everytime he dials any of his few providers and it supposed to do the following:
if provider1 has been called, do something, if provider2 has been called, do something else.
The only point we are missing here is to know how to get the name of the "active" provider smpppd is using, somehow via the command line.
Does it have to be the name of the provider? Why not use the IP info from ifconfig? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2007-01-03 at 15:06 -0500, James Knott wrote:
The only point we are missing here is to know how to get the name of the "active" provider smpppd is using, somehow via the command line.
Does it have to be the name of the provider? Why not use the IP info from ifconfig?
The IP is given as a parameter to the script, no need to search for it - or it should, at least. It is done for ip-up.local, dunno for if-up.d/ BASENAME=`basename $0` INTERFACE=$1 DEVICE=$2 SPEED=$3 LOCALIP=$4 REMOTEIP=$5 IPPARAM=$6 But there is no parameter there for the provider, to my knowledge (those parameters are given by the pppd daemon). There might be info inside "/var/run/smpppd/*". - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFnBcMtTMYHG2NR9URAkJeAJ9Uwz9BpNK2j8Egb0n6vaqMmP/ihACdF1FI DCraCFmOeCvONRuVW0LUPo4= =6sM2 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi, On Wed, 3 Jan 2007 21:50:19 +0100 (CET) "Carlos E. R." <.> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Wednesday 2007-01-03 at 15:06 -0500, James Knott wrote:
The only point we are missing here is to know how to get the name of the "active" provider smpppd is using, somehow via the command line.
Does it have to be the name of the provider? Why not use the IP info from ifconfig?
The IP is given as a parameter to the script, no need to search for it - or it should, at least. It is done for ip-up.local, dunno for if-up.d/
Thanks for both of you for the ideas! Generally my naive idea was to extract somehow the _name_ of the provider and personally I didn't think about to use the IPs. To be honest I have even no idea, if my friend uses few free providers, how different their IPs are... e.g. earlier I had Hungarian freemail and freeweb dial-up and there was time when they used the same range of dynamic IPs, but the first supposed to provide exclusively SMTP/POP access and the later one "only" internet... I think the best will be to wait until I travel back to Budapest to have a look on his settings personally. Thank you, Pelibali -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
pelibali wrote:
Hi,
On Wed, 3 Jan 2007 21:50:19 +0100 (CET) "Carlos E. R." <.> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Wednesday 2007-01-03 at 15:06 -0500, James Knott wrote:
The only point we are missing here is to know how to get the name of the "active" provider smpppd is using, somehow via the command line.
Does it have to be the name of the provider? Why not use the IP info from ifconfig?
The IP is given as a parameter to the script, no need to search for it - or it should, at least. It is done for ip-up.local, dunno for if-up.d/
Thanks for both of you for the ideas! Generally my naive idea was to extract somehow the _name_ of the provider and personally I didn't think about to use the IPs. To be honest I have even no idea, if my friend uses few free providers, how different their IPs are... e.g. earlier I had Hungarian freemail and freeweb dial-up and there was time when they used the same range of dynamic IPs, but the first supposed to provide exclusively SMTP/POP access and the later one "only" internet...
I think the best will be to wait until I travel back to Budapest to have a look on his settings personally.
If they are truly different ISP's, they will have different, though possibly similar address ranges. Also the default route should be unique for each one. You may be able to do a host lookup to see who has what address. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Saturday 2007-01-06 at 14:01 +0100, pelibali wrote:
Thanks for both of you for the ideas! Generally my naive idea was to extract somehow the _name_ of the provider and personally I didn't think about to use the IPs. To be honest I have even no idea, if my friend uses few free providers, how different their IPs are...
An idea. If you do a dns check on the IP, with the command "host", the domain of the IP will tell you the provider. You can do a 'grep' check on that name to find matches. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFoEpDtTMYHG2NR9URAqbZAJ9UCWvilSOoTQ1T44tJe+nx+DAJPQCeIj3M i7Ow44xg/NiMtwYOqgIwx5M= =VB+Y -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi, On Sun, 7 Jan 2007 02:17:54 +0100 (CET) "Carlos E. R." <.> wrote: ...
An idea.
If you do a dns check on the IP, with the command "host", the domain of the IP will tell you the provider. You can do a 'grep' check on that name to find matches.
I think this can be the winner; thank you Carlos! (My original idea to check the provider names my friend defined under his kinternet looks a little ridiculous now...) Pelibali -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2007-01-07 at 13:52 +0100, pelibali wrote:
An idea.
If you do a dns check on the IP, with the command "host", the domain of the IP will tell you the provider. You can do a 'grep' check on that name to find matches.
I think this can be the winner; thank you Carlos! (My original idea to check the provider names my friend defined under his kinternet looks a little ridiculous now...)
Absolutely not ridiculous. I also wanted that feature, and having the provider name is far easier for me than extracting it from the reverse dns by grepping and comparing. You see, when I used dial up I also used different providers. Depending on the provider, I have to use a different mail relay server, having to edit the postfix transport file; not having that, I edited it by hand before connecting. Had I been pissed enough, I would have written a wrap around script for wvdial. The IP thing did not occur to me at that time, though. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFoPKdtTMYHG2NR9URAgGoAJ0fIsBfCIqBX1BEPUesBdzGVgisOACdGvEe u4bg7SN/2zgrk5vpxE74KfA= =1ta3 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hi, On Sun, 7 Jan 2007 14:16:13 +0100 (CET) "Carlos E. R." <.> wrote: ...
You see, when I used dial up I also used different providers. Depending on the provider, I have to use a different mail relay server, having to edit the postfix transport file; not having that, I edited it by hand before connecting.
Had I been pissed enough, I would have written a wrap around script for wvdial. The IP thing did not occur to me at that time, though.
In most of my time I'm on SUSE 9.1 and making different profiles via scpm solved my similar problems. I still use it to change various configuration files; now having several home - home3D - institute - hotspot - budapest - girlfriend profiles. I have only simpler postfix configs, but was never a problem to change that via scpm switching. (The only issue I had was to get scpm remem- ber the proxy settings sitting in various files, but I managed to solve that. Anyway, openSUSE 10.x made that much more easy...) Regards, Pelibali -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Carlos E. R.
-
James Knott
-
pelibali