Bill Jonas on Fri, 26 May 2000 08:55:15 -0400 (EDT) |
I figured out what the problem was when trying to execute a script after connection via KPPP. I thought I'd share for the benefit of the group. This was done on Debian-based Corel, but is applicable to most any distro. KPPP is indeed a front-end to pppd. pppd, when it is executed, runs the /etc/ppp/ip-up and /etc/ppp/ip-down scripts after connection or disconnection, respectively. Debian has ip-up.d/ and ip-down.d/ directories under /etc/ppp/, which, as you've probably guessed, contain scripts that also get ran after connection. (SuSE looks for ip-up.local and ip-down.local scripts that contain all the commands you want to run. I would imagine that most distros have some variation on this theme. Slackware 7 appears to have a nearly-empty /etc/ppp/ containing just the 'options' file, but I'm not sure if this was modified by me somehow or not. In any case, one should be able to add ip-up and ip-down scripts there to be executed by pppd. I can't investigate this further right now since Slackware is my third boot option on the machine I'm on right now.) Continuing, though, the last functional line in Debian's ip-up script is 'run-parts /etc/ppp/ip-up.d'. run-parts is basically a command to do a 'for i in *;do $i;done' on the specified directory, with a few restrictions, such as filenames (see the man page on your system for details, if run-parts is installed). My script should have been executed, since I didn't break any filename rules (in fact, it was all alphabetic characters), but it wasn't. It wasn't until I ran run-parts manually on the directory that I discovered the problem. run-parts was refusing to run the script because there was no hash-bang line at the beginning. It was just an executable file with a single line for the command I wanted to perform. Once I added '#!/bin/sh' to the beginning of the file, though, run-parts happily ran the thing. Hope this was of some help. Bill -- >Ever heard of .cshrc? | "Linux means never having to delete That's a city in Bosnia. Right? | your love mail." -- Don Marti (Discussion in comp.os.linux.misc | http://www.netaxs.com/~bj/ on the intuitiveness of commands.) | http://www.harrybrowne.org/ ______________________________________________________________________ Philadelphia Linux Users Group - http://plug.nothinbut.net Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce General Discussion - http://lists.nothinbut.net/mail/listinfo/plug
|
|