- Initial release
This commit is contained in:
Stanislav Ievlev 2007-07-19 13:33:13 +04:00
commit a63aa6bde3
9 changed files with 84 additions and 0 deletions

3
.gear-rules Normal file
View File

@ -0,0 +1,3 @@
tar: alterator-net-common

34
alterator-net-common.spec Normal file
View File

@ -0,0 +1,34 @@
%define _altdata_dir %_datadir/alterator
Name: alterator-net-common
Version: 0.1
Release: alt1
Packager: Stanislav Ievlev <inger@altlinux.org>
Requires: etcnet
BuildArch: noarch
Source: %name-%version.tar
Summary: helpers for etcnet administration
License: GPL
Group: System/Base
Requires: openssl
%description
helpers for etcnet administration
%prep
%setup -q
%install
%makeinstall
%files
%_libexecdir/%name/
%changelog
* Thu Jul 19 2007 Stanislav Ievlev <inger@altlinux.org> 0.1-alt1
- Initial release

View File

@ -0,0 +1,6 @@
TOOLS=ifup ifdown ifvar iflist ifcheckup ifcheckplug
INSTALL=/usr/bin/install
install:
$(INSTALL) -d $(libexecdir)/alterator-net-common/
$(INSTALL) -pm755 $(TOOLS) $(libexecdir)/alterator-net-common/

View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/sbin/ifplugstatus "$1" >/dev/null 2>/dev/null

3
alterator-net-common/ifcheckup Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/sbin/ip -o link show dev "$1" 2>/dev/null |cut -d' ' -f3 |grep -qs -- '[<,]UP[,>]'

3
alterator-net-common/ifdown Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
env -i PATH="$PATH" HOME="$HOME" TMPDIR="$TMPDIR" /sbin/ifup "$1" >/dev/null

4
alterator-net-common/iflist Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
/sbin/ip -o a l|
sed -nre 's|^[0-9]+: ([^:]+): [^/]* link/ether ([a-f0-9:]+).*|\1 \2|p'

3
alterator-net-common/ifup Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
env -i PATH="$PATH" HOME="$HOME" TMPDIR="$TMPDIR" /sbin/ifup "$1" >/dev/null

25
alterator-net-common/ifvar Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
NAME="$1" && shift
VAR="$1" && shift
unset $VAR
. "${SCRIPTDIR:=/etc/net/scripts}/functions"
pickup_defaults
if [ -d "$IFACEDIR/$NAME@$NETHOST" ]; then
MYIFACEDIR="$IFACEDIR/$NAME@$NETHOST"
else
MYIFACEDIR="$IFACEDIR/$NAME"
fi
[ -d "$MYIFACEDIR" ] || {
print_error "interface configuration directory '$MYIFACEDIR' not found"
exit 1
}
export MYIFACEDIR NETPROFILE
init_netprofile
pickup_options
eval "echo \"\$$VAR\""