Call unit-command -1 <new> first time connected, close PR 569

This commit is contained in:
Andrey A. Chernov 1996-02-17 19:21:41 +00:00
parent 1494289f5b
commit 438a2cf9d4
2 changed files with 18 additions and 9 deletions

View File

@ -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

View File

@ -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);