[SLE] ~ /etc/ppp/ip-up.local
Hi SuSErs :) . . . could someone , please, kindly explain, WHERE in the script of /etc/ppp/ip-up , one should place the instruction to read and execute /etc/ppp/ip-up.local ? thanks a ton :) -- ____________ sent on Linux ____________ This Email is 100% Virus Free! How do I know? ~ Because no Microsoft products were used to generate it! -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
tabanna wrote:
Hi SuSErs :)
. . . could someone , please, kindly explain, WHERE in the script of /etc/ppp/ip-up , one should place the instruction to read and execute /etc/ppp/ip-up.local ?
thanks a ton :)
Well, the answer is to reask your above question. ;-). Because ip-up is a "one for all" script (ppp, ippp, ...?) there are the cases ippp*, ppp*, ippp= ISDN, ppp=modem. Below that you'll find the case "up" and "down" for each of the above. If you i.e. want to add a "fetchmail -f /etc/fetchmailrc" to be executed everytime a connection is made with ppp, search for the case ppp*, then for the next case "up", go to the end of the list and add it there. Juergen -- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
Hi, SuSErs ! . . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ? ~ thanks a ton :) ................................ #!/bin/sh # ip-up # (c) '97, S.u.S.E. GmbH, Fuerth, Germany # Klaus Franken <kfr@suse.de> # 25.02.98 # # Remo Behn <sray@suse.de> # 18.07.98 BASENAME=`basename $0` INTERFACE=$1 DEVICE=$2 SPEED=$3 LOCALIP=$4 REMOTEIP=$5 if [ -z "$REMOTEIP" ]; then echo "Usage: $0 <INTERFACE> <DEVICE> <SPEED> <LOCALIP> <REMOTEIP>" exit 1 fi case "$INTERFACE" in ippp*) . /etc/rc.config # find the device found=0 for I in $NETCONFIG; do eval NETDEV=\$NETDEV$I if [ $NETDEV = $INTERFACE ]; then found=1 break; fi done if [ $found -eq 0 ]; then echo "Device '$INTERFACE' not configured in '/etc/rc.config'" exit 1 fi eval IFCONFIG=\$IFCONFIG$I DEST=`grep -v "^#" /etc/route.conf | grep "$INTERFACE\$" | awk '{ print $1}'` DEFAULT=`grep -v "^#" /etc/route.conf | grep default | awk '{ print $2}'` #echo "ok, NETDEV:$NETDEV; IFCONFIG:$IFCONFIG." #echo " DEST: $DEST; DEFAULT: $DEFAULT" case "$BASENAME" in ip-up) # default deny #ipfwadm -I -p deny #ipfwadm -O -p deny # flush #ipfwadm -I -f #ipfwadm -O -f # accept dns #ipfwadm -O -a accept -P udp -S 0/0 53 1024:65535 -D 0/0 53 -W $INTERFACE #ipfwadm -I -a accept -P udp -D 0/0 53 1024:65535 -S 0/0 53 -W $INTERFACE #ipfwadm -O -a accept -P tcp -S 0/0 53 1024:65535 -D 0/0 53 -W $INTERFACE #ipfwadm -I -a accept -P tcp -D 0/0 53 1024:65535 -S 00/0 53 -k -W $INTERFACE # accept conect from client to internet #ipfwadm -O -a accept -P tcp -S 0/0 1024:65535 -D 0/0 -W $INTERFACE #ipfwadm -I -a accept -P tcp -D 0/0 1024:65535 -S 0/0 -k -W $INTERFACE # deny, last match #ipfwadm -I -a deny -P tcp -S 0/0 -D 0/0 -W $INTERFACE #ipfwadm -I -a deny -P udp -S 0/0 -D 0/0 -W $INTERFACE # default accept #ipfwadm -I -p accept #ipfwadm -O -p accept /sbin/route add default gw $REMOTEIP dev $INTERFACE # maybe you want to start mail services: # set follow variables in /etc/rc.config # SENDMAIL_TYPE="yes" # SENDMAIL_SMARTHOST="<ISP-mailserver>" # SENDMAIL_ARGS="-bd -om" # SENDMAIL_EXPENSIVE="yes" # SENDMAIL_NOCANONIFY="yes" #/usr/bin/fetchmail -a -v >>/var/log/fetchmail 2>&1 & #/usr/sbin/sendmail -q & ;; ip-down) # restart interface /sbin/ifconfig $INTERFACE down # workaround due to kernel problem with 'kernd': sleep 1 /sbin/ifconfig $INTERFACE $IFCONFIG # flush, del all rules #ipfwadm -I -f #ipfwadm -O -f # set routes from /etc/route.conf test -z "$DEST" || /sbin/route add -host $DEST dev $INTERFACE test -z "$DEFAULT" || /sbin/route add default gw $DEFAULT ;; *) ;; esac ;; ppp*) # Analog-PPP, add commands as you need... case "$BASENAME" in ip-up) # # This code allows automatic configuration of your resolv.conf # for peer supplied DNS addresses when using the `usepeerdns' # option. Original resolv.conf is restored when ip-down is called # by pppd when the link goes down. # if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then rm -f /etc/ppp/resolv.prev if [ -f /etc/resolv.conf ]; then cp -p /etc/resolv.conf /etc/ppp/resolv.prev grep domain /etc/ppp/resolv.prev > /etc/resolv.conf grep search /etc/ppp/resolv.prev >> /etc/resolv.conf cat /etc/ppp/resolv.conf /etc >> /etc/resolv.conf echo "Modified /etc/resolv.conf for DNS at $INTERFACE" else cp /etc/ppp/resolv.conf /etc chmod 644 /etc/resolv.conf echo "Installed /etc/resolv.conf for DNS at $INTERFACE" fi if [ "$START_NSCD" = yes ]; then /sbin/init.d/nscd restart & fi # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv echo "huhu" > /var/log/messages # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fi ;; ip-down) # # This code restores the original resolv.conf saved when ip-up # was called by the pppd which uses the `usepeerdns' option and # resolv.conf was modified for the supplied dns server adresses. # if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then if [ -f /etc/ppp/resolv.prev ]; then cp -fp /etc/ppp/resolv.prev /etc/resolv.conf echo "Restored original /etc/resolv.conf" else rm -f /etc/resolv.conf echo "Deinstalled /etc/resolv.conf" fi if [ "$START_NSCD" = yes ]; then /sbin/init.d/nscd restart & fi fi ;; *) ;; esac | logger -t $BASENAME ;; *) # dont know... ;; esac ................................................... .. . . I have made my ip-up.local EXecutable . . . but things ain't working ! Thanks :) Richard ________ -- ____________ sent on Linux ____________ This Email is 100% Virus Free! How do I know? ~ Because no Microsoft products were used to generate it! -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
What is inside $USEPEERDNS? I gues it is defined and set in rc.config. Did you check it? On Tue, 5 Sep 2000, tabanna wrote:
Hi, SuSErs !
. . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ?
~ thanks a ton :)
................................ #!/bin/sh # ip-up # (c) '97, S.u.S.E. GmbH, Fuerth, Germany # Klaus Franken <kfr@suse.de> # 25.02.98 # # Remo Behn <sray@suse.de> # 18.07.98
BASENAME=`basename $0` INTERFACE=$1 DEVICE=$2 SPEED=$3 LOCALIP=$4 REMOTEIP=$5
if [ -z "$REMOTEIP" ]; then echo "Usage: $0 <INTERFACE> <DEVICE> <SPEED> <LOCALIP> <REMOTEIP>" exit 1 fi
case "$INTERFACE" in ippp*)
. /etc/rc.config
# find the device found=0 for I in $NETCONFIG; do eval NETDEV=\$NETDEV$I if [ $NETDEV = $INTERFACE ]; then found=1 break; fi done if [ $found -eq 0 ]; then echo "Device '$INTERFACE' not configured in '/etc/rc.config'" exit 1 fi
eval IFCONFIG=\$IFCONFIG$I DEST=`grep -v "^#" /etc/route.conf | grep "$INTERFACE\$" | awk '{ print $1}'` DEFAULT=`grep -v "^#" /etc/route.conf | grep default | awk '{ print $2}'`
#echo "ok, NETDEV:$NETDEV; IFCONFIG:$IFCONFIG." #echo " DEST: $DEST; DEFAULT: $DEFAULT"
case "$BASENAME" in ip-up)
# default deny #ipfwadm -I -p deny #ipfwadm -O -p deny
# flush #ipfwadm -I -f #ipfwadm -O -f
# accept dns #ipfwadm -O -a accept -P udp -S 0/0 53 1024:65535 -D 0/0 53 -W $INTERFACE #ipfwadm -I -a accept -P udp -D 0/0 53 1024:65535 -S 0/0 53 -W $INTERFACE #ipfwadm -O -a accept -P tcp -S 0/0 53 1024:65535 -D 0/0 53 -W $INTERFACE #ipfwadm -I -a accept -P tcp -D 0/0 53 1024:65535 -S 00/0 53 -k -W $INTERFACE
# accept conect from client to internet #ipfwadm -O -a accept -P tcp -S 0/0 1024:65535 -D 0/0 -W $INTERFACE #ipfwadm -I -a accept -P tcp -D 0/0 1024:65535 -S 0/0 -k -W $INTERFACE
# deny, last match #ipfwadm -I -a deny -P tcp -S 0/0 -D 0/0 -W $INTERFACE #ipfwadm -I -a deny -P udp -S 0/0 -D 0/0 -W $INTERFACE
# default accept #ipfwadm -I -p accept #ipfwadm -O -p accept
/sbin/route add default gw $REMOTEIP dev $INTERFACE
# maybe you want to start mail services: # set follow variables in /etc/rc.config # SENDMAIL_TYPE="yes" # SENDMAIL_SMARTHOST="<ISP-mailserver>" # SENDMAIL_ARGS="-bd -om" # SENDMAIL_EXPENSIVE="yes" # SENDMAIL_NOCANONIFY="yes" #/usr/bin/fetchmail -a -v >>/var/log/fetchmail 2>&1 & #/usr/sbin/sendmail -q & ;; ip-down) # restart interface /sbin/ifconfig $INTERFACE down
# workaround due to kernel problem with 'kernd': sleep 1 /sbin/ifconfig $INTERFACE $IFCONFIG
# flush, del all rules #ipfwadm -I -f #ipfwadm -O -f
# set routes from /etc/route.conf test -z "$DEST" || /sbin/route add -host $DEST dev $INTERFACE test -z "$DEFAULT" || /sbin/route add default gw $DEFAULT
;; *) ;; esac ;;
ppp*) # Analog-PPP, add commands as you need... case "$BASENAME" in ip-up) #
# This code allows automatic configuration of your resolv.conf # for peer supplied DNS addresses when using the `usepeerdns' # option. Original resolv.conf is restored when ip-down is called # by pppd when the link goes down. # if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then rm -f /etc/ppp/resolv.prev if [ -f /etc/resolv.conf ]; then cp -p /etc/resolv.conf /etc/ppp/resolv.prev grep domain /etc/ppp/resolv.prev > /etc/resolv.conf grep search /etc/ppp/resolv.prev >> /etc/resolv.conf cat /etc/ppp/resolv.conf /etc >> /etc/resolv.conf echo "Modified /etc/resolv.conf for DNS at $INTERFACE" else cp /etc/ppp/resolv.conf /etc chmod 644 /etc/resolv.conf echo "Installed /etc/resolv.conf for DNS at $INTERFACE" fi if [ "$START_NSCD" = yes ]; then /sbin/init.d/nscd restart & fi # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
echo "huhu" > /var/log/messages
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fi ;; ip-down) # # This code restores the original resolv.conf saved when ip-up # was called by the pppd which uses the `usepeerdns' option and # resolv.conf was modified for the supplied dns server adresses. # if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then if [ -f /etc/ppp/resolv.prev ]; then cp -fp /etc/ppp/resolv.prev /etc/resolv.conf echo "Restored original /etc/resolv.conf" else rm -f /etc/resolv.conf echo "Deinstalled /etc/resolv.conf" fi if [ "$START_NSCD" = yes ]; then /sbin/init.d/nscd restart & fi fi
;; *) ;; esac | logger -t $BASENAME ;; *) # dont know... ;; esac
...................................................
.. . . I have made my ip-up.local EXecutable . . . but things ain't working !
Thanks :)
Richard ________
-- ____________ sent on Linux ____________
This Email is 100% Virus Free! How do I know? ~ Because no Microsoft products were used to generate it!
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
tabanna tapped away at the keyboard with:
. . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ?
[snip]
echo "huhu" > /var/log/messages
Don't do that... syslogd will probably over-write it. See manual entry for 'logger' for the cooperative method of logging using syslog. -- Bernd Felsche - Innovative Reckoning Perth, Western Australia -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
This may be an error. Try the command echo "$huhu" >> /var/log/messages <-- NOTE the >> See what happens! There may be nothing there. Regards, Bruce
tabanna tapped away at the keyboard with:
. . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ?
[snip]
echo "huhu" > /var/log/messages
Don't do that... syslogd will probably over-write it.
See manual entry for 'logger' for the cooperative method of logging using syslog.
-- Bernd Felsche - Innovative Reckoning Perth, Western Australia
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
The >> will certainly work, but not the $huhu. However, by redirecting to /var/log/messages will cause the entry to be inserted without a date stamp. Use the logger(1) command: echo "huhu" | logger You may want to set a priority to the message with the -p option. On 6 Sep 2000, at 21:08, Bruce wrote:
This may be an error. Try the command echo "$huhu" >> /var/log/messages <-- NOTE the >> See what happens! There may be nothing there. Regards, Bruce
tabanna tapped away at the keyboard with:
. . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ?
[snip]
echo "huhu" > /var/log/messages
Don't do that... syslogd will probably over-write it.
See manual entry for 'logger' for the cooperative method of logging using syslog.
-- Bernd Felsche - Innovative Reckoning Perth, Western Australia
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
-- Jerry Feldman Contractor, eInfrastructure Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Compaq Computer Corp. 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752 -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
On Tue, 5 Sep 2000 18:13:04 +0000, tabanna wrote: | | Hi, SuSErs ! | | . . . any ideas, please, why, my <echo "huhu"> , inserted in this | Klaus Franken script, does NOT run ? | | ~ thanks a ton :) Oh don't worry. The echo command runs perfectly. But the question is, where does the output go? Or better put: where is STDOUT pointing to? You guessed wrong if you thought that STDOUT would always show up on your terminal screen... If I am correct pppd redirects STDOUT to /dev/null... Koos Pol ---------------------------------------------------------------------- S.C. Pol T: +31 20 3116122 Systems Administrator F: +31 20 3116200 Compuware Europe B.V. E: koos_pol@nl.compuware.com Amsterdam PGP public key available -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
Dear SuSEr's I guess everyone is missing the point "its not how to get an entry done in /var/log/messages file at all" The point here is "where in the script one should add the neccessary command to execute ip-up.local" Hope it is clear, we have been trying to sort this out - but no success.
Hi, SuSErs !
. . . any ideas, please, why, my <echo "huhu"> , inserted in this Klaus Franken script, does NOT run ?
TIA - Maneesh -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
On Wed, 06 Sep 2000, Maneesh Bomb wrote:
I guess everyone is missing the point "its not how to get an entry done in /var/log/messages file at all" The point here is "where in the script one should add the neccessary command to execute ip-up.local" Hope it is clear, we have been trying to sort this out - but no success.
Hello Maneesh, ~ that's it . . . . "HOW to add the neccessary command to execute ip-up.local" ? ? ? &%^# NOT so easy :( thanks -- ____________ sent on Linux ____________ This Email is 100% Virus Free! How do I know? ~ Because no Microsoft products were used to generate it! -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
Hello tabanna, on Wednesday, September 06, 2000 at 16:37:01 +0000, you sat in front of your keyboard and wrote:
~ that's it . . . . "HOW to add the neccessary command to execute ip-up.local" ? ? ?
&%^# NOT so easy :(
thanks
Try putting: test -x /etc/ppp/ip-up.local && /etc/ppp/ip-up.local $* where you put your echo command. Regards... -- Jean-François Bocquet <tns01@free.fr> == Error is not forever, hope for right+ |== ICQ: 69968770 ===================== Darkness is not the opposite of light| |== http://tns01.free.fr ========== -But only absence- day will follow night.| +-- Linux User #177410 --------------------------------------------*-- Lowell+ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
On Wed, 06 Sep 2000, Jean-François Bocquet wrote:
. . . "HOW to add the neccessary command to execute ip-up.local" ? ? ?
Try putting: test -x /etc/ppp/ip-up.local && /etc/ppp/ip-up.local $* where you put your echo command.
Hello, Jean-François ~ thank you :) . . . NO ! It won't work, ~ zip_nothing. . . . this 'dead-end' is reason for trying, if, it would, at least, <echo "huhu"> . . . and, you know what, { Murphy is near} it will not <echo "huhu"> {;-> best wishes Richard ________ ____________ sent on Linux ____________ This Email is 100% Virus Free! How do I know? ~ Because no Microsoft products were used to generate it! -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
Hi, On Tue, Sep 05 2000 at 11:27 +0000, tabanna wrote:
. . . could someone , please, kindly explain, WHERE in the script of /etc/ppp/ip-up , one should place the instruction to read and execute /etc/ppp/ip-up.local ?
They're already at the appropriate places. Just create ip-up.local and/or ip-down.local and make them executable. Ciao, Stefan -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
participants (10)
-
bernie@innovative.iinet.net.au
-
bomb@infini.org.in
-
bruce@toorak.com
-
gerry.feldman@compaq.com
-
juergen.braukmann@ruhr-west.de
-
kastus@tsoft.com
-
koos_pol@nl.compuware.com
-
stefan.troeger@wirtschaft.tu-chemnitz.de
-
tabanna@aig.forthnet.gr
-
tns01@free.fr