projects
/
grml-shlib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c8a1064
)
Fixed some typos, Cleanup of whitespaces
author
Michael Prokop
<mika@grml.org>
Sun, 3 Jun 2007 23:18:10 +0000
(
01:18
+0200)
committer
Michael Prokop
<mika@grml.org>
Sun, 3 Jun 2007 23:18:10 +0000
(
01:18
+0200)
debian/changelog
patch
|
blob
|
history
sh-lib
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index
22a520c
..
9b4207d
100644
(file)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-1,3
+1,10
@@
+grml-shlib (1.02.12) unstable; urgency=low
+
+ * Fixed some typos.
+ * Cleanup of whitespaces.
+
+ -- Michael Prokop <mika@grml.org> Mon, 04 Jun 2007 01:17:35 +0200
+
grml-shlib (1.02.11) unstable; urgency=low
* a few type corrections
grml-shlib (1.02.11) unstable; urgency=low
* a few type corrections
diff --git
a/sh-lib
b/sh-lib
index
5d0ac5b
..
4511f21
100644
(file)
--- a/
sh-lib
+++ b/
sh-lib
@@
-4,7
+4,7
@@
# Authors: grml-team (grml.org), (c) Michael Gebetsroither <gebi@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
# Authors: grml-team (grml.org), (c) Michael Gebetsroither <gebi@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mon
May 02 00:17:44 CEST 2005 [gebi
]
+# Latest change: Mon
Jun 04 01:17:23 CEST 2007 [mika
]
################################################################################
################################################################################
@@
-70,7
+70,7
@@
function vprint
local level_="$1"
local type_="$2"
local message_="$3"
local level_="$1"
local type_="$2"
local message_="$3"
-
+
if [ $VERBOSE__ -ge $level_ -a -n "$message_" ]; then
echo -n "$type_" >&2
echo "$message_" >&2
if [ $VERBOSE__ -ge $level_ -a -n "$message_" ]; then
echo -n "$type_" >&2
echo "$message_" >&2
@@
-152,7
+152,7
@@
function syslog
{
local message_="$1" # error message
local exit_code_="$2"
{
local message_="$1" # error message
local exit_code_="$2"
-
+
if [ -n "$exit_code_" ]; then
logger -p user.alert -t "$PROG_NAME__" -i "$message_ ret($exit_code_)" >&2
else
if [ -n "$exit_code_" ]; then
logger -p user.alert -t "$PROG_NAME__" -i "$message_ ret($exit_code_)" >&2
else
@@
-178,10
+178,10
@@
function warnLog
###
##
###
##
-# ATTENTION... THIS FUNCTI
NOS
IS A BIG SECURITY HOLE
+# ATTENTION... THIS FUNCTI
ON
IS A BIG SECURITY HOLE
# this function will be changed in future release
##
# this function will be changed in future release
##
-#
i don't want to write exit status controle
stuff every time
+#
I don't want to write exit status control
stuff every time
function execute
{
local to_exec_="$1" # command to execute
function execute
{
local to_exec_="$1" # command to execute
@@
-313,13
+313,13
@@
function checkRoot
function isGrml
{
function isGrml
{
- if [ -f /etc/grml_version ] ; then
+ if [ -f /etc/grml_version ] ; then
dprint "isGrml(): this seems to be a grml system"
dprint "isGrml(): this seems to be a grml system"
- return 0
- else
+ return 0
+ else
dprint "isGrml(): this is not a grml system"
dprint "isGrml(): this is not a grml system"
- return 1
- fi
+ return 1
+ fi
}
function runsFromHd
}
function runsFromHd
@@
-349,7
+349,7
@@
function runsFromCd
function secureInput
{
local to_secure_="$1"
function secureInput
{
local to_secure_="$1"
-
+
local secured_=''
secured_=`echo -n "$to_secure_" |tr -c '[:alnum:]/.\-,\(\)' '_'`
local secured_=''
secured_=`echo -n "$to_secure_" |tr -c '[:alnum:]/.\-,\(\)' '_'`
@@
-441,10
+441,10
@@
function checkBootParam
# validates an IP FIXME
function netValidIp
{
# validates an IP FIXME
function netValidIp
{
- local ip_="$1" # ip address
e
to validate
+ local ip_="$1" # ip address to validate
local error_function_=${2:-"eprint"} # function to call on error
local message_="$3" # user supplied error message
local error_function_=${2:-"eprint"} # function to call on error
local message_="$3" # user supplied error message
-
+
local ret_=''
echo "$ip_" | grep -E -q -e '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}' \
local ret_=''
echo "$ip_" | grep -E -q -e '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}' \
@@
-452,14
+452,14
@@
function netValidIp
ret_=$?
if [ $ret_ -ne 0 ]; then
if [ -z "$message_" ]; then
ret_=$?
if [ $ret_ -ne 0 ]; then
if [ -z "$message_" ]; then
- "$error_function_" "ip-address
e \"$ip_\" is NOT valie
d" $ret_
+ "$error_function_" "ip-address
\"$ip_\" is NOT vali
d" $ret_
else
"$error_function_" "$message_" $ret_
fi
return 1
fi
else
"$error_function_" "$message_" $ret_
fi
return 1
fi
- dprint "ip-address
e \"$ip_\" is valie
d" $ret_
+ dprint "ip-address
\"$ip_\" is vali
d" $ret_
return $ret_
}
return $ret_
}
@@
-490,10
+490,10
@@
function netGetDefaultGateway
{
local error_function_=${1:-"eprint"} # function to call on error
local message_="$2" # user supplied error message
{
local error_function_=${1:-"eprint"} # function to call on error
local message_="$2" # user supplied error message
-
+
local ip_=''
local ret_=''
local ip_=''
local ret_=''
-
+
setCLang
ip_=`route -n | awk '/^0\.0\.0\.0/{print $2; exit}'`
ret_=$?
setCLang
ip_=`route -n | awk '/^0\.0\.0\.0/{print $2; exit}'`
ret_=$?
@@
-517,10
+517,10
@@
function netGetNetmask
local iface_="$1"
local error_function_=${2:-"eprint"} # function to call on error
local message_="$3" # user supplied error message
local iface_="$1"
local error_function_=${2:-"eprint"} # function to call on error
local message_="$3" # user supplied error message
-
+
local nm_=''
local ret_=''
local nm_=''
local ret_=''
-
+
setCLang
nm_=`ifconfig "$iface_" | awk '/[Mm]ask/{FS="[: ]*"; $0=$0; print $8; exit}'`
ret_=$?
setCLang
nm_=`ifconfig "$iface_" | awk '/[Mm]ask/{FS="[: ]*"; $0=$0; print $8; exit}'`
ret_=$?
@@
-528,7
+528,7
@@
function netGetNetmask
if [ -z "$nm_" ]; then
if [ -z "$message_" ]; then
"$error_function_" "could not find a netmask for \"$iface_\"" $ret_
if [ -z "$nm_" ]; then
if [ -z "$message_" ]; then
"$error_function_" "could not find a netmask for \"$iface_\"" $ret_
- else
+ else
"$error_function_" "$message_" $ret_
fi
return 1
"$error_function_" "$message_" $ret_
fi
return 1
@@
-561,16
+561,16
@@
function netGetIp
fi
return 1
fi
fi
return 1
fi
- dprint "address
e
for \"$iface_\" is \"$ip_\"" $ret_
+ dprint "address for \"$iface_\" is \"$ip_\"" $ret_
echo "$ip_"
return 0
echo "$ip_"
return 0
-}
+}
function netGetNameservers
{
local error_function_=${1:-"eprint"} # function to call on error
local message_="$2" # user supplied error message
function netGetNameservers
{
local error_function_=${1:-"eprint"} # function to call on error
local message_="$2" # user supplied error message
-
+
local file_="/etc/resolv.conf"
local ns_=""
local file_="/etc/resolv.conf"
local ns_=""
@@
-578,7
+578,7
@@
function netGetNameservers
warn "file \"$file_\" does not exist, could not get nameservers"
return 1
fi
warn "file \"$file_\" does not exist, could not get nameservers"
return 1
fi
-
+
setCLang
ns_=`awk '/^nameserver/{printf "%s ",$2}' $file_ |xargs echo`
restoreLang
setCLang
ns_=`awk '/^nameserver/{printf "%s ",$2}' $file_ |xargs echo`
restoreLang
@@
-625,7
+625,7
@@
function _touchService
if [ ! -x "$service_path_" ]; then
warn "_touchService(): service is not executable: \"$service_\""
fi
if [ ! -x "$service_path_" ]; then
warn "_touchService(): service is not executable: \"$service_\""
fi
-
+
local ret_=""
"$service_path_" "$action_"
ret_=$?
local ret_=""
"$service_path_" "$action_"
ret_=$?
@@
-660,7
+660,7
@@
function findNextFreeLoop
local tmp_='' # tmp
local i='' # counter
local ret_='' # saved return value
local tmp_='' # tmp
local i='' # counter
local ret_='' # saved return value
-
+
for i in 'losetup' 'losetup.orig'; do
tmp_=`$i -f 2>/dev/null`
if [ $? -eq 0 ]; then
for i in 'losetup' 'losetup.orig'; do
tmp_=`$i -f 2>/dev/null`
if [ $? -eq 0 ]; then
@@
-698,10
+698,10
@@
function findNextFreeLoop
function _initProgName
{
local name_="$1" # program name
function _initProgName
{
local name_="$1" # program name
-
+
local tmp_name_=`basename "$name_"` || \
logger -p user.alert -i "Init-initProgName: problems executing ( basename \"$name_\" ) ret($?)" >/dev/null
local tmp_name_=`basename "$name_"` || \
logger -p user.alert -i "Init-initProgName: problems executing ( basename \"$name_\" ) ret($?)" >/dev/null
-
+
secureInput "$tmp_name_"
}
PROG_NAME__=`_initProgName "$0"`
secureInput "$tmp_name_"
}
PROG_NAME__=`_initProgName "$0"`