projects
/
carnet-tools-cn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f26d821
)
r10:
author
Ivan Rako
<Ivan.Rako@CARNet.hr>
Mon, 21 Mar 2005 09:01:49 +0000
(09:01 +0000)
committer
Ivan Rako
<Ivan.Rako@CARNet.hr>
Mon, 21 Mar 2005 09:01:49 +0000
(09:01 +0000)
functions.sh
patch
|
blob
|
history
diff --git
a/functions.sh
b/functions.sh
index
45d15e2
..
6e01cfd
100644
(file)
--- a/
functions.sh
+++ b/
functions.sh
@@
-7,14
+7,14
@@
cp_get_ifaddr() {
[ -z "$interface" ] && interface=lo
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
[ -z "$interface" ] && interface=lo
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
- [ -z "$CP_ECHO_RETURN" ] || echo "cp_get_ifaddr: $interface: No such interface"
+ echo "cp_get_ifaddr: $interface: No such interface" 1>&2
return 1
fi
ifaddr="`/sbin/ifconfig $interface | awk '/inet/{ printf("%s\n",substr($2,index($2,":")+1)) }'`"
if [ -z $ifaddr ]; then
return 1
fi
ifaddr="`/sbin/ifconfig $interface | awk '/inet/{ printf("%s\n",substr($2,index($2,":")+1)) }'`"
if [ -z $ifaddr ]; then
- [ -z "$CP_ECHO_RETURN" ] || echo "cp_get_ifaddr: $interface: No such ipaddress"
+ echo "cp_get_ifaddr: $interface: No such ipaddress" 1>&2
return 1
fi
return 1
fi
@@
-31,14
+31,14
@@
cp_get_ifmask() {
[ -z "$interface" ] && interface=lo
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
[ -z "$interface" ] && interface=lo
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
- [ -z "$CP_ECHO_RETURN" ] || echo "cp_get_ifmask: $interface: No such interface"
+ echo "cp_get_ifmask: $interface: No such interface" 1>&2
return 1
fi
ifmask="`/sbin/ifconfig $interface | awk '/Mask/{if($3~/Mask/)a=$3;else if ($4~/Mask/)a=$4;printf ("%s\n", substr(a,index(a,":")+1))}'`"
if [ -z "$ifmask" ]; then
return 1
fi
ifmask="`/sbin/ifconfig $interface | awk '/Mask/{if($3~/Mask/)a=$3;else if ($4~/Mask/)a=$4;printf ("%s\n", substr(a,index(a,":")+1))}'`"
if [ -z "$ifmask" ]; then
- [ -z "$CP_ECHO_RETURN" ] || echo "cp_get_ifmask: $interface: No such netmask"
+ echo "cp_get_ifmask: $interface: No such netmask" 1>&2
return 1
fi
return 1
fi
@@
-77,20
+77,20
@@
cp_get_netaddr() {
fi
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
fi
if ! ifconfig $interface 2> /dev/null >> /dev/null; then
- [ "$CP_VERBOSE" ] || echo "cp_get_netaddr: $interface: No such interface"
+ echo "cp_get_netaddr: $interface: No such interface" 1>&2
goto return1
fi
cp_get_ifaddr "$interface"
ipaddress="$RET"
if [ -z $ipaddress ]; then
goto return1
fi
cp_get_ifaddr "$interface"
ipaddress="$RET"
if [ -z $ipaddress ]; then
- [ "$CP_VERBOSE" ] || echo "cp_get_netaddr: $interface: No such ipaddress"
+ echo "cp_get_netaddr: $interface: No such ipaddress" 1>&2
goto return1
fi
cp_get_ifmask "$interface"
netmask="$RET"
if [ -z $netmask ]; then
goto return1
fi
cp_get_ifmask "$interface"
netmask="$RET"
if [ -z $netmask ]; then
- [ "$CP_VERBOSE" ] || echo "cp_get_netaddr: $interface: No such netmask"
+ echo "cp_get_netaddr: $interface: No such netmask" 1>&2
fi
if [ "$netmask" = "255.255.255.255" ]; then
fi
if [ "$netmask" = "255.255.255.255" ]; then
@@
-115,11
+115,11
@@
cp_backup_conffile() {
local file_bak
if [ -z $1 ]; then
local file_bak
if [ -z $1 ]; then
- [ -z "$CP_ECHO_RETURN" ] || echo "Usage: cp_backup_conffile <file>"
+ echo "Usage: cp_backup_conffile <file>" 1>&2
return 1
fi
if [ ! -f $1 ]; then
return 1
fi
if [ ! -f $1 ]; then
- [ -z "$CP_ECHO_RETURN" ] || echo "cp_backup_conffile: $1: No such file"
+ echo "cp_backup_conffile: $1: No such file" 1>&2
return 1
fi
return 1
fi