summaryrefslogtreecommitdiffstats
path: root/sbin/startslip
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-09-15 16:41:10 +0000
committerache <ache@FreeBSD.org>1995-09-15 16:41:10 +0000
commit71c209a0a00f12775f41eb90581b91323367949f (patch)
tree77d469c0d11457a34cdea3392e8414efceb7b5f3 /sbin/startslip
parent5ec051983ec6706687bb4f7d44b2fd52d434cf86 (diff)
downloadFreeBSD-src-71c209a0a00f12775f41eb90581b91323367949f.zip
FreeBSD-src-71c209a0a00f12775f41eb90581b91323367949f.tar.gz
Pass sequence number to called scripts via LINE env. variable.
It allows specific per phone number tunings
Diffstat (limited to 'sbin/startslip')
-rw-r--r--sbin/startslip/startslip.113
-rw-r--r--sbin/startslip/startslip.c8
2 files changed, 18 insertions, 3 deletions
diff --git a/sbin/startslip/startslip.1 b/sbin/startslip/startslip.1
index 2ce0161..66404f9 100644
--- a/sbin/startslip/startslip.1
+++ b/sbin/startslip/startslip.1
@@ -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
diff --git a/sbin/startslip/startslip.c b/sbin/startslip/startslip.c
index 7c72f57..95a773b 100644
--- a/sbin/startslip/startslip.c
+++ b/sbin/startslip/startslip.c
@@ -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");
OpenPOWER on IntegriCloud