4 Commits

Author SHA1 Message Date
Jay Larson
508121866c The following changes were made:
* Added dash as dependency
  * Added URL
  * Added REPO
  * Moved usher from bash to /bin/sh
  * Removed TARGET from usher
  * Tweaked SRC Makefile to work with /bin/sh
2018-03-27 09:17:00 -05:00
Jay Larson
7793e4bc19 The following changes were made
* Removed non POSIX redirects
  * Removed setting of loopback up (seems to do this on its own?)
  * Corrected $verbose variable check (was -z, should be -n)
  * Added quotes for ip route command around $iface (colon was a problem)
  * Should note that v1.2 was incorrectly set in Makefile previously
2017-11-26 18:21:10 -06:00
Jay Larson
9730a62265 Corrected loopback device - will now set IP 2017-11-18 08:48:35 -06:00
Jay Larson
68281843d3 The following changes were made:
* Completely re-written as shell script
  * Modified documentation to better reflect reality
  * Removed the rather useless 'ifquery' tool
2017-11-05 11:34:59 -06:00
6 changed files with 462 additions and 951 deletions

View File

@@ -8,19 +8,20 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS = dhclient,iproute2,perl
DEPENDS = dash,dhclient,iproute2
ARCH = none
URL =
URL = http://snaplinux.org/
REPO = core
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 = 1
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

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
@@ -7,8 +7,8 @@ case $1 in
exit 0
;;
postinst)
if [ ! -f ${TARGET}/etc/network.conf ]; then
cp ${TARGET}/usr/share/iftools/network.conf ${TARGET}/etc/network.conf
if [ ! -f /etc/network.conf ]; then
cp /usr/share/iftools/network.conf /etc/network.conf
fi
;;
prerm)

View File

@@ -2,7 +2,8 @@ dirs:
install -d -v -m 755 $(DESTDIR)/etc/init.d
install -d -v -m 755 $(DESTDIR)/etc/network.d
install -d -v -m 755 $(DESTDIR)/usr/share/iftools
install -d -v -m 755 $(DESTDIR)/usr/share/man/man{5,8}
install -d -v -m 755 $(DESTDIR)/usr/share/man/man5
install -d -v -m 755 $(DESTDIR)/usr/share/man/man8
install -d -v -m 755 $(DESTDIR)/sbin
files:
@@ -16,10 +17,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