summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-12-05 11:26:03 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2007-12-05 11:26:03 -0800
commit2f9ea52c4ed0415509dcdd8c786da773cefc041b (patch)
tree983ec2405e31c207be997a1934a2b617af4e4cca
parent4dbba52a5b7e97d55ea7c4f957f594204350b9b2 (diff)
downloadvyatta-op-2f9ea52c4ed0415509dcdd8c786da773cefc041b.tar.gz
vyatta-op-2f9ea52c4ed0415509dcdd8c786da773cefc041b.zip
use symlink instead of wrapper for ethtool
-rw-r--r--.gitignore2
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac4
-rw-r--r--debian/control4
-rw-r--r--debian/vyatta-op.postinst.in9
-rw-r--r--debian/vyatta-op.postrm.in11
-rwxr-xr-xscripts/vyatta-ethtool-wrapper4
-rw-r--r--templates/show/interfaces/ethernet/node.tag/physical/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def2
9 files changed, 29 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 285a1b5..c0e9c47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,8 @@
/configure
/debian/files
/debian/vyatta-op
+/debian/vyatta-op.postinst
+/debian/vyatta-op.postrm
/etc/default/vyatta
/INSTALL
/Makefile.in
diff --git a/Makefile.am b/Makefile.am
index 656d279..ac4aa61 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,6 @@ bin_SCRIPTS += scripts/vyatta-show-version
bin_sudo_users_SCRIPTS = scripts/vyatta-show-log
bin_sudo_users_SCRIPTS += scripts/vyatta-show-log-all
bin_sudo_users_SCRIPTS += scripts/vyatta-show-log-file
-bin_sudo_users_SCRIPTS += scripts/vyatta-ethtool-wrapper
cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
cpio -0pd
diff --git a/configure.ac b/configure.ac
index 631597b..30d16dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,9 @@ AC_ARG_ENABLE([nostrip],
AC_CONFIG_FILES(
[Makefile]
- [etc/default/vyatta])
+ [etc/default/vyatta]
+ [debian/vyatta-op.postinst]
+ [debian/vyatta-op.postrm])
AC_SUBST(NOSTRIP)
diff --git a/debian/control b/debian/control
index 3517600..a5c9b9f 100644
--- a/debian/control
+++ b/debian/control
@@ -9,12 +9,12 @@ Package: vyatta-op
Architecture: all
Depends: bash (>= 3.1),
sed (>= 4.1.5),
+ ethtool,
+ ntpdate,
procps (>= 1:3.2.7-3),
coreutils (>= 5.97-5.3)
Suggests: util-linux (>= 2.13-5),
net-tools,
- ethtool,
ncurses-bin (>= 5.5-5),
- ntpdate
Description: bash operational command completion
Vyatta operational command bash completion script and base templates
diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in
new file mode 100644
index 0000000..b95d509
--- /dev/null
+++ b/debian/vyatta-op.postinst.in
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+
+# add symlinks for sudo
+ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool
+
diff --git a/debian/vyatta-op.postrm.in b/debian/vyatta-op.postrm.in
new file mode 100644
index 0000000..75d77ca
--- /dev/null
+++ b/debian/vyatta-op.postrm.in
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+
+if [ "$1" = "purge" ]; then
+ # remove added symlinks
+ rm -f ${bindir}/sudo-users/ethtool
+fi
+
diff --git a/scripts/vyatta-ethtool-wrapper b/scripts/vyatta-ethtool-wrapper
deleted file mode 100755
index 8753bd6..0000000
--- a/scripts/vyatta-ethtool-wrapper
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-ethtool "$@"
-
diff --git a/templates/show/interfaces/ethernet/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/physical/node.def
index 3e4e2bc..a9628fd 100644
--- a/templates/show/interfaces/ethernet/node.tag/physical/node.def
+++ b/templates/show/interfaces/ethernet/node.tag/physical/node.def
@@ -1,3 +1,3 @@
help: Show physical device information of given ethernet interface
allowed: ""
-run: sudo ${vyatta_bindir}/sudo-users/vyatta-ethtool-wrapper $4
+run: sudo ${vyatta_bindir}/sudo-users/ethtool $4
diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def
index d2e8593..9769aaa 100644
--- a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def
+++ b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def
@@ -1,2 +1,2 @@
help: Show given virtual network interface pseudo-physical information
-run: sudo ${vyatta_bindir}/sudo-users/vyatta-ethtool-wrapper $4.$6
+run: sudo ${vyatta_bindir}/sudo-users/ethtool $4.$6