summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
Diffstat (limited to 'helper')
-rw-r--r--helper/useradd.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/helper/useradd.inc b/helper/useradd.inc
index f8675dd5..bc139021 100644
--- a/helper/useradd.inc
+++ b/helper/useradd.inc
@@ -70,6 +70,9 @@ add_user() {
local _PASSWD=${INIT_DIR}/etc/passwd
local _GROUP=${INIT_DIR}/etc/group
local _SHADOW=${INIT_DIR}/etc/shadow
+ [ ! -f "${_PASSWD}" ] && perror "add_user: password file does not exist in target system. (build base first)"
+ [ ! -f "${_GROUP}" ] && perror "add_user: group file does not exist in target system. (build base first)"
+ [ ! -f "${_SHADOW}" ] && perror "add_user: shadow file does not exist in target system. (build base first)"
if [ "x$1" != "x" ]
then
local USER=$1
@@ -151,6 +154,7 @@ add_group () {
local _PASSWD=${INIT_DIR}/etc/passwd
local _GROUP=${INIT_DIR}/etc/group
local _SHADOW=${INIT_DIR}/etc/shadow
+ [ ! -f "${_GROUP}" ] && perror "add_user: group file does not exist in target system. (build base first)"
local GROUP=$1
local GROUPID="-"
if ! [[ $GROUP =~ $NAME_REGEX ]]; then