aboutsummaryrefslogtreecommitdiff
path: root/sbin/slattach
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-02-17 19:21:41 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-02-17 19:21:41 +0000
commit438a2cf9d4bcbc7f238a135b0c6b03213dc8d97f (patch)
tree710f038c9338a65b1a78378772d96763f9e20916 /sbin/slattach
parent1494289f5b6a71f56b3526cbf0ea5406c22517e1 (diff)
downloadsrc-438a2cf9d4bcbc7f238a135b0c6b03213dc8d97f.tar.gz
src-438a2cf9d4bcbc7f238a135b0c6b03213dc8d97f.zip
Call unit-command -1 <new> first time connected, close PR 569
Notes
Notes: svn path=/head/; revision=14128
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 abccc1b59201..2642320b81bb 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 aa70b11d97d6..a115f3e50ac6 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);