summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorSimon Rettberg2013-02-25 20:13:48 +0100
committerSimon Rettberg2013-02-25 20:13:48 +0100
commit8d34cf49ad72e556b88033202f7dde130d80fa74 (patch)
tree3b73845f6e83f6caa47215173ca1899acc0f262d /helper
parentfix tarcopy call for base (diff)
downloadtm-scripts-8d34cf49ad72e556b88033202f7dde130d80fa74.tar.gz
tm-scripts-8d34cf49ad72e556b88033202f7dde130d80fa74.tar.xz
tm-scripts-8d34cf49ad72e556b88033202f7dde130d80fa74.zip
Several fixes and improvements:
- return uid and gid again for add_user and add_group - abort execution if sourcing the .build or .conf file of a module fails - make sure lightdm user and group exists when building the ldm module - use tarcopy in all modules if appropriate
Diffstat (limited to 'helper')
-rw-r--r--helper/useradd.inc4
1 files changed, 3 insertions, 1 deletions
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() {