The following changes were made:

* Completely re-written as shell script
  * Modified documentation to better reflect reality
  * Removed the rather useless 'ifquery' tool
This commit is contained in:
2017-11-05 11:34:59 -06:00
parent 53077da060
commit 68281843d3
5 changed files with 434 additions and 946 deletions

View File

@@ -8,19 +8,19 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS = dhclient,iproute2,perl
DEPENDS = dhclient,iproute2
ARCH = none
URL =
BRIEF = Scripts for starting and stopping network interfaces
DESC = Scripts which use the iproute2 tools for automatically starting and \
stopping network devices during startup.
SNAPVER = 2
SNAPVER = 0
ARCHIVE :=
SRCDIR := $(PWD)/SRC/iftools
PATCHDIR := $(PWD)/SRC/patches
VERSION := $(shell grep 'VERSION\s*=>' SRC/iftools/ifup| \
cut -d "'" -f2)-$(SNAPVER)
VERSION := $(shell grep 'VERSION=' SRC/iftools/ifup| \
cut -d "=" -f2)-$(SNAPVER)
include /usr/share/snap/Makefile.snaplinux

View File

@@ -16,10 +16,8 @@ files:
links:
ln -s ifup.8 $(DESTDIR)/usr/share/man/man8/ifdown.8
ln -s ifup.8 $(DESTDIR)/usr/share/man/man8/ifquery.8
ln -s ifup.8 $(DESTDIR)/usr/share/man/man8/ifreload.8
ln -s ifup $(DESTDIR)/sbin/ifdown
ln -s ifup $(DESTDIR)/sbin/ifquery
ln -s ifup $(DESTDIR)/sbin/ifreload
install: dirs files links

File diff suppressed because it is too large Load Diff

View File

@@ -5,30 +5,25 @@ ifup \- bring a network interface up
ifdown \- take a network interface down
.br
ifreload \- reload interface configuration
.br
ifquery \- view current state of interfaces
.SH SYNOPSIS
.B ifup
\f |
.B ifdown
\f |
.B ifreload
\f |
.B ifquery
\f <OPTIONS> <INTERFACES>
.SH DESCRIPTION
The
.BR ifup " and " ifdown
commands may be used to configure (or, respectively, deconfigure) network
commands may be used to configure, or deconfigure network
interfaces based on interface definitions in the file
.IR /etc/network.conf ". The"
.BR ifreload " command will perform an ifdown and ifup in one command."
.BR ifquery " may be used to display the running configuration."
.SH OPTIONS
A summary of options is included below.
.TP
.BR \-a ", " \-\-all
If given to \fBifup\fP, affect all interfaces marked \fBauto\fP.
.BR \-a
If given to \fBifup\fP, all interfaces marked \fBauto\fP are brought online.
Interfaces are brought up in the order in which they are defined
in
.IR /etc/network.conf .
@@ -36,17 +31,17 @@ If given to \fBifdown\fP, affect all defined interfaces.
Interfaces are brought down in the order in which they are
listed in the configuration files.
.TP
.BR \-h ", " \-\-help
.BR \-h
Show summary of options.
.TP
.BR \-n ", " \-\-no\-act
Don't configure any interfaces or run any "up" or "down" commands.
.BR \-n
Take no action, but output commands that would be executed.
.TP
.BR \-V ", " \-\-version
Show copyright and version information.
.BR \-v
Show configuration steps as they are taken.
.TP
.BR \-v ", " \-\-verbose
Show commands as they are executed.
.BR \-V
Show version information.
.SH EXAMPLES
.TP
.B ifup -a
@@ -62,25 +57,17 @@ Bring up interface
.TP
.B ifdown -a
Bring down all interfaces that are currently up.
.TP
.B ifquery eth0
Print the running configuration of eth0
.SH NOTES
.BR ifup ,
.BR ifdown ,
.BR ifreload ,
and
.BR ifquery
.BR ifreload
are actually the same program called by different names.
.P
The program does not configure network interfaces directly;
it runs low level utilities such as
.BR ip
to do its dirty work.
.P
When invoked a check will be performed to verify that there
are no other instances running. If another instance is
detected the program will exit with an error.
.SH FILES
.TP
.I /etc/network.conf
@@ -88,9 +75,6 @@ definitions of network interfaces
See
.BR network.conf (5)
for more information.
.TP
.I /run/network/ifstate
current state of network interfaces
.SH AUTHOR
iftools was written by Jay Larson <jlarson@snaplinux.org>. The functionality is loosely based on the ifupdown suite written by Anthony Towns <aj@azure.humbug.org.au>.
.SH SEE ALSO

View File

@@ -46,8 +46,8 @@ There can be multiple "auto" stanzas.
brings the named interfaces up in the order listed.
.P
Lines beginning with "source-directory" are used to source multiple
files at once. All non-dotted files within the directory are sourced
in lexical order.
files at once. All non-dotted files ending in .conf within the directory
are sourced in lexical order.
.P
When sourcing directories, if a path doesn't have a leading slash
it's considered relative to the directory containing the network.conf