summaryrefslogtreecommitdiffstats
path: root/sbin/slattach
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-02-17 19:21:41 +0000
committerache <ache@FreeBSD.org>1996-02-17 19:21:41 +0000
commit11d43035a036520de406b386b2021248a5c83936 (patch)
tree710f038c9338a65b1a78378772d96763f9e20916 /sbin/slattach
parente9a4f674d90661f3436ff997b54b3f194364dabe (diff)
downloadFreeBSD-src-11d43035a036520de406b386b2021248a5c83936.zip
FreeBSD-src-11d43035a036520de406b386b2021248a5c83936.tar.gz
Call unit-command -1 <new> first time connected, close PR 569
Diffstat (limited to 'sbin/slattach')
-rw-r--r--sbin/slattach/slattach.821
-rw-r--r--sbin/slattach/slattach.c6
2 files changed, 18 insertions, 9 deletions
diff --git a/sbin/slattach/slattach.8 b/sbin/slattach/slattach.8
index abccc1b..2642320 100644
--- a/sbin/slattach/slattach.8
+++ b/sbin/slattach/slattach.8
@@ -31,7 +31,7 @@
.\"
.\" @(#)slattach.8 6.4 (Berkeley) 3/16/91
.\"
-.\" $Header: /home/ncvs/src/sbin/slattach/slattach.8,v 1.8 1995/10/26 05:13:54 nate Exp $
+.\" $Header: /home/ncvs/src/sbin/slattach/slattach.8,v 1.9 1996/01/29 23:52:39 mpp Exp $
.\"
.Dd April 4, 1993
.Dt SLATTACH 8
@@ -105,19 +105,27 @@ Specifies the speed of the connection. If not specified, the
default of 9600 is used.
.It Fl u Ar unit-command
When the line is switched to slip discipline, run
-.Ql sh \-c Ar unit-command <last> <current>
+.Ql Nm "sh -c" Ar unit-command <old> <new>
where
-.Ar <last>
+.Ar <old>
and
-.Ar <current>
+.Ar <new>
are the slip unit numbers when the line was
last opened and the unit number of the current slip connection
respectively. The unit number can change after redialing if you are
using more than one slip line.
+When
+.Nm slattach
+connected first time, it run
+.Ql Nm "sh -c" Ar unit-command Nm \-1 Ar <new> .
+When
+.Nm slattach
+disconnected, it run
+.Ql Nm "sh -c" Ar unit-command <old> Nm \-1 .
.Nm Slattach
will abort if the unit number
changes and
-.Fl u Ar unit-command
+.Ql Fl u Ar \%unit-command
was not specified.
.It Fl z
forces redial
@@ -240,7 +248,8 @@ process and can be examined by scripts in oder to send a signal to
.Xr netintro 4 ,
.Xr ifconfig 8 ,
.Xr rc 8 ,
-.Xr uustat 1
+.Xr uustat 1 ,
+/usr/share/examples/slattach
.Sh HISTORY
The
.Nm
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c
index aa70b11..a115f3e 100644
--- a/sbin/slattach/slattach.c
+++ b/sbin/slattach/slattach.c
@@ -424,9 +424,6 @@ void configure_network()
syslog(LOG_ERR, "ioctl(SLIOCGUNIT): %m");
exit_handler(1);
}
- /* don't compare unit numbers if this is the first time to attach. */
- if (unit < 0)
- unit = new_unit;
/* iff the unit number changes either invoke config_cmd or punt. */
if (config_cmd) {
char *s;
@@ -438,6 +435,9 @@ void configure_network()
free (s);
unit = new_unit;
} else {
+ /* don't compare unit numbers if this is the first time to attach. */
+ if (unit < 0)
+ unit = new_unit;
if (new_unit != unit) {
syslog(LOG_ERR, "slip unit changed from sl%d to sl%d, but no -u CMD was specified!");
exit_handler(1);
OpenPOWER on IntegriCloud