Skip to content

Commit

Permalink
should work with /bin/sh and not only with /bin/bash
Browse files Browse the repository at this point in the history
fixes #78: bareos-config is not portable

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Feb 17, 2015
1 parent 88a0e60 commit cd21e97
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/bareos-config
@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/sh

DIR_CFG=/etc/bareos
CFG_DIR=${DIR_CFG}/bareos-dir.conf
DIR_SCRIPTS=/usr/lib/bareos/scripts
Expand Down Expand Up @@ -31,16 +32,19 @@ help()
is_function()
{
func=$1
test "$func" && type -t "$func" > /dev/null 2>&1
local rc=$?
return $rc
test "$func" && type "$func" > /dev/null 2>&1
return $?
}

list_functions()
{
# show available shell functions,
# but exclude internal functions (name starts with "_" ...)
typeset -F | cut -d " " -f 3 | grep "^[a-z]"
if type typeset >/dev/null 2>&1; then
# show available shell functions,
# but exclude internal functions (name starts with "_" ...)
typeset -F | cut -d " " -f 3 | grep "^[a-z]"
else
echo "function list not available"
fi
}

# TODO: use defines
Expand Down

0 comments on commit cd21e97

Please sign in to comment.