Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9730a62265 | ||
|
|
68281843d3 | ||
|
|
53077da060 | ||
|
|
e50782227d |
6
Makefile
6
Makefile
@@ -8,7 +8,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
DEPENDS = iproute2,perl
|
DEPENDS = dhclient,iproute2
|
||||||
ARCH = none
|
ARCH = none
|
||||||
URL =
|
URL =
|
||||||
BRIEF = Scripts for starting and stopping network interfaces
|
BRIEF = Scripts for starting and stopping network interfaces
|
||||||
@@ -19,8 +19,8 @@ SNAPVER = 0
|
|||||||
ARCHIVE :=
|
ARCHIVE :=
|
||||||
SRCDIR := $(PWD)/SRC/iftools
|
SRCDIR := $(PWD)/SRC/iftools
|
||||||
PATCHDIR := $(PWD)/SRC/patches
|
PATCHDIR := $(PWD)/SRC/patches
|
||||||
VERSION := $(shell grep 'VERSION\s*=>' SRC/iftools/ifup| \
|
VERSION := $(shell grep 'VERSION=' SRC/iftools/ifup| \
|
||||||
cut -d "'" -f2)-$(SNAPVER)
|
cut -d "=" -f2)-$(SNAPVER)
|
||||||
|
|
||||||
include /usr/share/snap/Makefile.snaplinux
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
|
|
||||||
|
|||||||
20
SNAP/usher
Executable file
20
SNAP/usher
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
preinst)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
postinst)
|
||||||
|
if [ ! -f ${TARGET}/etc/network.conf ]; then
|
||||||
|
cp ${TARGET}/usr/share/iftools/network.conf ${TARGET}/etc/network.conf
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
prerm)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
postrm)
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -3,8 +3,10 @@ dirs:
|
|||||||
install -d -v -m 755 $(DESTDIR)/etc/network.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/iftools
|
||||||
install -d -v -m 755 $(DESTDIR)/usr/share/man/man{5,8}
|
install -d -v -m 755 $(DESTDIR)/usr/share/man/man{5,8}
|
||||||
|
install -d -v -m 755 $(DESTDIR)/sbin
|
||||||
|
|
||||||
files:
|
files:
|
||||||
|
install -v -m 755 ifup $(DESTDIR)/sbin/ifup
|
||||||
install -v -m 755 network.init $(DESTDIR)/etc/init.d/network
|
install -v -m 755 network.init $(DESTDIR)/etc/init.d/network
|
||||||
install -v -m 755 network.conf \
|
install -v -m 755 network.conf \
|
||||||
$(DESTDIR)/usr/share/iftools/network.conf
|
$(DESTDIR)/usr/share/iftools/network.conf
|
||||||
@@ -12,4 +14,10 @@ files:
|
|||||||
$(DESTDIR)/usr/share/man/man5/network.conf.5
|
$(DESTDIR)/usr/share/man/man5/network.conf.5
|
||||||
install -v -m 644 ifup.8 $(DESTDIR)/usr/share/man/man8/ifup.8
|
install -v -m 644 ifup.8 $(DESTDIR)/usr/share/man/man8/ifup.8
|
||||||
|
|
||||||
install: dirs files
|
links:
|
||||||
|
ln -s ifup.8 $(DESTDIR)/usr/share/man/man8/ifdown.8
|
||||||
|
ln -s ifup.8 $(DESTDIR)/usr/share/man/man8/ifreload.8
|
||||||
|
ln -s ifup $(DESTDIR)/sbin/ifdown
|
||||||
|
ln -s ifup $(DESTDIR)/sbin/ifreload
|
||||||
|
|
||||||
|
install: dirs files links
|
||||||
|
|||||||
1345
SRC/iftools/ifup
1345
SRC/iftools/ifup
File diff suppressed because it is too large
Load Diff
@@ -5,30 +5,25 @@ ifup \- bring a network interface up
|
|||||||
ifdown \- take a network interface down
|
ifdown \- take a network interface down
|
||||||
.br
|
.br
|
||||||
ifreload \- reload interface configuration
|
ifreload \- reload interface configuration
|
||||||
.br
|
|
||||||
ifquery \- view current state of interfaces
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B ifup
|
.B ifup
|
||||||
\f |
|
\f |
|
||||||
.B ifdown
|
.B ifdown
|
||||||
\f |
|
\f |
|
||||||
.B ifreload
|
.B ifreload
|
||||||
\f |
|
|
||||||
.B ifquery
|
|
||||||
\f <OPTIONS> <INTERFACES>
|
\f <OPTIONS> <INTERFACES>
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The
|
||||||
.BR ifup " and " ifdown
|
.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
|
interfaces based on interface definitions in the file
|
||||||
.IR /etc/network.conf ". The"
|
.IR /etc/network.conf ". The"
|
||||||
.BR ifreload " command will perform an ifdown and ifup in one command."
|
.BR ifreload " command will perform an ifdown and ifup in one command."
|
||||||
.BR ifquery " may be used to display the running configuration."
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
A summary of options is included below.
|
A summary of options is included below.
|
||||||
.TP
|
.TP
|
||||||
.BR \-a ", " \-\-all
|
.BR \-a
|
||||||
If given to \fBifup\fP, affect all interfaces marked \fBauto\fP.
|
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
|
Interfaces are brought up in the order in which they are defined
|
||||||
in
|
in
|
||||||
.IR /etc/network.conf .
|
.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
|
Interfaces are brought down in the order in which they are
|
||||||
listed in the configuration files.
|
listed in the configuration files.
|
||||||
.TP
|
.TP
|
||||||
.BR \-h ", " \-\-help
|
.BR \-h
|
||||||
Show summary of options.
|
Show summary of options.
|
||||||
.TP
|
.TP
|
||||||
.BR \-n ", " \-\-no\-act
|
.BR \-n
|
||||||
Don't configure any interfaces or run any "up" or "down" commands.
|
Take no action, but output commands that would be executed.
|
||||||
.TP
|
.TP
|
||||||
.BR \-V ", " \-\-version
|
.BR \-v
|
||||||
Show copyright and version information.
|
Show configuration steps as they are taken.
|
||||||
.TP
|
.TP
|
||||||
.BR \-v ", " \-\-verbose
|
.BR \-V
|
||||||
Show commands as they are executed.
|
Show version information.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.TP
|
.TP
|
||||||
.B ifup -a
|
.B ifup -a
|
||||||
@@ -62,25 +57,17 @@ Bring up interface
|
|||||||
.TP
|
.TP
|
||||||
.B ifdown -a
|
.B ifdown -a
|
||||||
Bring down all interfaces that are currently up.
|
Bring down all interfaces that are currently up.
|
||||||
.TP
|
|
||||||
.B ifquery eth0
|
|
||||||
Print the running configuration of eth0
|
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
.BR ifup ,
|
.BR ifup ,
|
||||||
.BR ifdown ,
|
.BR ifdown ,
|
||||||
.BR ifreload ,
|
|
||||||
and
|
and
|
||||||
.BR ifquery
|
.BR ifreload
|
||||||
are actually the same program called by different names.
|
are actually the same program called by different names.
|
||||||
.P
|
.P
|
||||||
The program does not configure network interfaces directly;
|
The program does not configure network interfaces directly;
|
||||||
it runs low level utilities such as
|
it runs low level utilities such as
|
||||||
.BR ip
|
.BR ip
|
||||||
to do its dirty work.
|
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
|
.SH FILES
|
||||||
.TP
|
.TP
|
||||||
.I /etc/network.conf
|
.I /etc/network.conf
|
||||||
@@ -88,9 +75,6 @@ definitions of network interfaces
|
|||||||
See
|
See
|
||||||
.BR network.conf (5)
|
.BR network.conf (5)
|
||||||
for more information.
|
for more information.
|
||||||
.TP
|
|
||||||
.I /run/network/ifstate
|
|
||||||
current state of network interfaces
|
|
||||||
.SH AUTHOR
|
.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>.
|
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
|
.SH SEE ALSO
|
||||||
|
|||||||
@@ -1,16 +1,4 @@
|
|||||||
auto lo
|
auto lo
|
||||||
iface lo inet loopback
|
iface lo inet loopback
|
||||||
|
|
||||||
# An example of an interface automatically started on boot with dhcp
|
|
||||||
#auto eth0
|
|
||||||
#iface eth0 inet dhcp
|
|
||||||
|
|
||||||
# Another example with a static IP and static route
|
|
||||||
#iface eth1 inet static
|
|
||||||
# address 192.168.0.202
|
|
||||||
# netmask 255.255.255.0
|
|
||||||
# gateway 192.168.0.1
|
|
||||||
# route 192.168.3.0 via 192.168.0.100
|
|
||||||
|
|
||||||
# This requests that all files in /etc/network.d be appended
|
|
||||||
source-directory network.d
|
source-directory network.d
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ There can be multiple "auto" stanzas.
|
|||||||
brings the named interfaces up in the order listed.
|
brings the named interfaces up in the order listed.
|
||||||
.P
|
.P
|
||||||
Lines beginning with "source-directory" are used to source multiple
|
Lines beginning with "source-directory" are used to source multiple
|
||||||
files at once. All non-dotted files within the directory are sourced
|
files at once. All non-dotted files ending in .conf within the directory
|
||||||
in lexical order.
|
are sourced in lexical order.
|
||||||
.P
|
.P
|
||||||
When sourcing directories, if a path doesn't have a leading slash
|
When sourcing directories, if a path doesn't have a leading slash
|
||||||
it's considered relative to the directory containing the network.conf
|
it's considered relative to the directory containing the network.conf
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: $network
|
# Provides: $network
|
||||||
# Required-Start: $local_fs swap localnet
|
# Required-Start: $local_fs swap
|
||||||
# Required-Stop: $local_fs swap localnet
|
# Required-Stop: $local_fs swap
|
||||||
# Should-Start: $syslog
|
# Should-Start: $syslog
|
||||||
# Should-Stop: $syslog
|
# Should-Stop: $syslog
|
||||||
# Default-Start: 3 4 5
|
# Default-Start: 3 4 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Short-Description: Starts and configures network interfaces.
|
# Short-Description: Start and configure network interfaces
|
||||||
# Description: Starts and configures network interfaces.
|
# X-Required: true
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
log_info_msg "Bringing up network interfaces"
|
log_init_msg "Bringing up network interfaces"
|
||||||
ifup -a && log_success_msg || log_failure_msg
|
ifup -a && log_success_msg || log_failure_msg
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
log_info_msg "Bringing down network interfaces"
|
log_init_msg "Bringing down network interfaces"
|
||||||
ifdown -a && log_success_msg || log_failure_msg
|
ifdown -a && log_success_msg || log_failure_msg
|
||||||
;;
|
;;
|
||||||
|
|
||||||
reload|restart)
|
reload|restart)
|
||||||
log_info_msg "Restarting network interfaced"
|
log_init_msg "Restarting network interfaces"
|
||||||
ifreload -a && log_success_msg || log_failure_msg
|
ifreload -a && log_success_msg || log_failure_msg
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user