Pass sequence number to called scripts via LINE env. variable.

It allows specific per phone number tunings
This commit is contained in:
Andrey A. Chernov 1995-09-15 16:41:10 +00:00
parent 7c8e2aa48c
commit 13811ba072
2 changed files with 18 additions and 3 deletions

View File

@ -132,10 +132,21 @@ Default value is no flow control.
.It Fl U Ar upscript
Specifies a script to run when a SLIP interface becomes connected. This may
contain ifconfig, route, and other appropriate commands. The arguments that
are passed to the script are "slX up". Default value is "/sbin/ifconfig".
are passed to the script are "slX up".
Default value is "/sbin/ifconfig".
Dial sequence number (see
.Fl s )
passed via
.Dv LINE
environment variable.
.It Fl D Ar downscript
Specifies a script to run when a SLIP connection goes away. The arguments that
are passed to the script are "slX down". Default value is "/sbin/ifconfig".
Dial sequence number (see
.Fl s )
passed via
.Dv LINE
environment variable.
.El
.Sh FILES
.Bl -tag -width /var/run/startslip-<device>.pid -compact

View File

@ -227,7 +227,9 @@ main(argc, argv)
} else
restart:
if (logged_in) {
sprintf(buf, "%s %s down &", downscript ? downscript : "/sbin/ifconfig" , unitname);
sprintf(buf, "LINE=%d %s %s down &",
diali ? (dialc - 1) % diali : 0,
downscript ? downscript : "/sbin/ifconfig" , unitname);
(void) system(buf);
}
if (terminate)
@ -445,7 +447,9 @@ restart:
(void) dup2(0, 2);
}
sprintf(buf, "%s %s up &", upscript ? upscript : "/sbin/ifconfig" , unitname);
sprintf(buf, "LINE=%d %s %s up &",
diali ? (dialc - 1) % diali : 0,
upscript ? upscript : "/sbin/ifconfig" , unitname);
(void) system(buf);
printd(", ready\n");