summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorJonathan Bauer2013-02-27 17:18:55 +0100
committerJonathan Bauer2013-02-27 17:18:55 +0100
commitfd7d5b81d0e2c193bf5ca678e054c216da03f90c (patch)
tree0e742a553c62c064f51a701c6ceed500b8c37a9f /helper
parentusing binutils EVERYWHERE (diff)
parentImplemented more flexible command line parsing (diff)
downloadtm-scripts-fd7d5b81d0e2c193bf5ca678e054c216da03f90c.tar.gz
tm-scripts-fd7d5b81d0e2c193bf5ca678e054c216da03f90c.tar.xz
tm-scripts-fd7d5b81d0e2c193bf5ca678e054c216da03f90c.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Conflicts: remote/setup_tools remote/tools/base/base.build remote/tools/dbus/dbus.build
Diffstat (limited to 'helper')
-rw-r--r--helper/logging.inc10
-rw-r--r--helper/useradd.inc4
2 files changed, 8 insertions, 6 deletions
diff --git a/helper/logging.inc b/helper/logging.inc
index 2d79c67c..42906e1e 100644
--- a/helper/logging.inc
+++ b/helper/logging.inc
@@ -11,10 +11,10 @@ LOG_DIR=${ROOT_DIR}/logs
mkdir -p "$LOG_DIR"
set_quiet () {
- if [ "x$DEBUG" != "x1" -a "x$MLTK_QUIET" != "x1" ]; then
- exec 6>&1 > "$LOG_DIR/stdout.log"
- exec 7>&2 2> "$LOG_DIR/stderr.log"
- MLTK_QUIET="1"
+ if [ "x$MLTK_QUIET" != "x1" ]; then
+ exec 6>&1 > "$LOG_DIR/stdout.log"
+ exec 7>&2 2> "$LOG_DIR/stderr.log"
+ MLTK_QUIET="1"
fi
}
@@ -42,7 +42,7 @@ pwarning () {
}
pdebug () {
- if [ "x$DEBUG" != "x1" ]; then
+ if [ "x$MLTK_QUIET" = "x1" ]; then
echo -e "[DEBUG] $TOOL_STR $@" >&2
else
echo -e "\033[38;5;6m[debug]\033[0m $TOOL_STR $@" >&6
diff --git a/helper/useradd.inc b/helper/useradd.inc
index 798e997c..bcbb25b2 100644
--- a/helper/useradd.inc
+++ b/helper/useradd.inc
@@ -149,6 +149,7 @@ add_user() {
pinfo "Updated password of $USER"
fi
[ -z "${_GID}" ] && pinfo "Created group $GROUP" && echo "${GROUP}:x:${GROUPID}:" >> "${_GROUP}"
+ echo "${USERID}"
}
add_group () {
@@ -166,7 +167,7 @@ add_group () {
fi
[ $# -ge 2 ] && [ ! -z "$2" ] && GROUPID=$2
local _GID=$(grep -E "^${GROUP}:[^:]*:[0-9]+:" "${_GROUP}" | head -1 | awk -F ':' '{print $3}')
- [ "x${_GID}" != "x" ] && [ "x$GROUPID" = "x-" -o "x$GROUPID" = "x${_GID}" ] && return # nothing to do, already exists
+ [ "x${_GID}" != "x" ] && [ "x$GROUPID" = "x-" -o "x$GROUPID" = "x${_GID}" ] && echo "${_GID}" && return # nothing to do, already exists
[ "x${_GID}" != "x" ] && perror "Group $GROUP already exists with GID ${_GID}, but creation was requested with GID $GROUPID"
if [ "x$GROUPID" = "x-" ]; then
local _UID=$(grep -E "^${GROUP}:[^:]*:[0-9]+:" "${_PASSWD}" | head -1 | awk -F ':' '{print $3}')
@@ -178,6 +179,7 @@ add_group () {
fi
echo "${GROUP}:x:${GROUPID}:" >> "${_GROUP}"
pinfo "Created group $GROUP"
+ echo "${GROUPID}"
}
init_users_and_groups() {