diff options
author | joerg <joerg@FreeBSD.org> | 1995-09-29 22:03:13 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-09-29 22:03:13 +0000 |
commit | 695113e9d5998d28cba0ecf50b6822ea07c2921c (patch) | |
tree | 502e2459103fe7ee1bf4f30d2d3d56a89bbd1cd3 /sbin | |
parent | c0bde4017e2cff9ab332280521aaaac2cda4eddc (diff) | |
download | FreeBSD-src-695113e9d5998d28cba0ecf50b6822ea07c2921c.zip FreeBSD-src-695113e9d5998d28cba0ecf50b6822ea07c2921c.tar.gz |
Call the -u UCMD command on exit. The command is called with the
current unit number, and the "new" unit number of -1. This allows the
script to actually deconfigure the SLIP interface (e.g. by running
"ifconfig delete") which has been impossible previously.
This is most likely a candidate for 2.1, too.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/slattach/slattach.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index 1fa776e..aa70b11 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -576,6 +576,15 @@ void exit_handler(int ret) /* Remove the PID file */ (void)unlink(pidfilename); + if (config_cmd) { + char *s; + s = (char*) malloc(strlen(config_cmd) + 32); + sprintf (s, "%s %d -1", config_cmd, unit); + syslog(LOG_NOTICE, "Deconfiguring %s (sl%d):", dev, unit); + syslog(LOG_NOTICE, " '%s'", s); + system(s); + free (s); + } /* invoke a shell for exit_cmd. */ if (exit_cmd) { syslog(LOG_NOTICE,"exiting after running %s", exit_cmd); |