projects
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e34107e
)
Removed the selector from ifup.
author
Francois Fleuret
<francois@fleuret.org>
Sun, 16 Jan 2011 17:25:13 +0000
(18:25 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sun, 16 Jan 2011 17:25:13 +0000
(18:25 +0100)
bashrc
patch
|
blob
|
history
diff --git
a/bashrc
b/bashrc
index
f264e2c
..
6dc9780
100644
(file)
--- a/
bashrc
+++ b/
bashrc
@@
-283,21
+283,13
@@
function dt () {
function ifup () {
echo "${VT_BOLD}${VT_GREEN_FG}This is the bash function ifup from .bashrc${VT_RESET}"
function ifup () {
echo "${VT_BOLD}${VT_GREEN_FG}This is the bash function ifup from .bashrc${VT_RESET}"
- if [[ "$1" == "-s" ]]; then
- chosen_ifup=$(mktemp /tmp/chosen_ifup.XXXXXX)
- selector -i -d -o ${chosen_ifup} ${IFUPRC}
- ARGS=$(cat ${chosen_ifup})
- rm -f ${chosen_ifup}
- echo ${ARGS} >> ${IFUPRC}
+ if [[ ! "$@" ]] && [[ -s ${IFUPRC} ]]; then
+ # If we have no argument and there is a .ifuprc, use it
+ ARGS=$(tail -1 ${IFUPRC})
else
else
- if [[ ! $* ]] && [[ -s ${IFUPRC} ]]; then
- # If we have no argument and there is a .ifuprc, use it
- ARGS=$(tail -1 ${IFUPRC})
- else
- # Otherwise uses the given arguments, and store them
- ARGS=$*
- echo ${ARGS} >> ${IFUPRC}
- fi
+ # Otherwise uses the given arguments, and store them
+ ARGS="$@"
+ echo ${ARGS} >> ${IFUPRC}
fi
echo "${VT_GREEN_FG}Running [sudo ifup ${ARGS}]${VT_RESET}"
sudo ifup ${ARGS}
fi
echo "${VT_GREEN_FG}Running [sudo ifup ${ARGS}]${VT_RESET}"
sudo ifup ${ARGS}
@@
-315,13
+307,13
@@
function ifup () {
function ifdown () {
echo "${VT_BOLD}${VT_GREEN_FG}This is the bash function ifdown from .bashrc${VT_RESET}"
function ifdown () {
echo "${VT_BOLD}${VT_GREEN_FG}This is the bash function ifdown from .bashrc${VT_RESET}"
- if [[ !
$*
]] && [[ -s ${IFUPRC} ]]; then
+ if [[ !
"$@"
]] && [[ -s ${IFUPRC} ]]; then
# If there are no arguments and there is a .ifuprc, get the
# interface from it
ARGS=$(tail -1 ${IFUPRC} | sed -e "s/=.*$//")
else
# Otherwise, use the standard ifdown
# If there are no arguments and there is a .ifuprc, get the
# interface from it
ARGS=$(tail -1 ${IFUPRC} | sed -e "s/=.*$//")
else
# Otherwise, use the standard ifdown
- ARGS=
$*
+ ARGS=
"$@"
fi
echo "${VT_GREEN_FG}Running sudo [ifdown ${ARGS}]${VT_RESET}"
sudo ifdown ${ARGS}
fi
echo "${VT_GREEN_FG}Running sudo [ifdown ${ARGS}]${VT_RESET}"
sudo ifdown ${ARGS}