echo "${FUNCNAME}(), invalid level argument : ${*}"
return 1
fi
-
+
# Making sure bootscript has correct permissions
chmod -v 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME}
echo "${FUNCNAME}(), wrong number of arguments: ${*}"
return 1
fi
-
+
# Checking if file exists
if [ ! -f ${FILE} ]; then
echo "${FUNCNAME}(), file not found: ${FILE}"
echo "${FUNCNAME}(), wrong number of arguments: ${*}"
return 1
fi
-
+
# Checking if file exists
if [ ! -f ${FILE} ]; then
echo "${FUNCNAME}(), file not found: ${FILE}"
# Variable value is NOT enclosed by double-quotes
sed -i "s!\(^export ${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE}
fi
-
+
return $?
}
echo "${FUNCNAME}(), wrong number of arguments: ${*}"
return 1
fi
-
+
# Checking if file exists
if [ ! -f ${FILE} ]; then
echo "${FUNCNAME}(), file not found: ${FILE}"
echo "${FUNCNAME}(), string already defined: ${STRING}"
return 0
fi
-
+
echo "${STRING}" >> ${FILE}
}
echo "${FUNCNAME}(), wrong number of arguments: ${*}"
return 1
fi
-
+
# Checking if file exists
if [ ! -f ${FILE} ]; then
echo "${FUNCNAME}(), file not found: ${FILE}"
last_argument=${*}
shift
done
-
+
groupadd ${arguments}
error=$?
{
arguments="${*}"
- set +e
-
# The last argument is the username
while [ $# -ne 0 ]; do
- last_argument=${*}
+ username=${*}
shift
done
- useradd ${arguments}
- error=$?
-
- set -e
-
- if [ ${error} -eq 0 -o ${error} -eq 9 ]; then
- # 9 means the user already exists
- return ${EXIT_SUCCESS}
- else
- exit ${EXIT_FAILURE}
+ if ! cat /etc/passwd | egrep "^${username}:" 1> /dev/null 2>&1; then
+ useradd ${arguments}
fi
}
echo "Usage: ${FUNCNAME} PACKAGE-NAME"
exit ${EXIT_FAILURE}
fi
-
+
if [ $# -eq 2 ]; then
TARGET_DIR=${2}
else
TARGET_DIR=${PACKAGE}
fi
-
+
# Checking if we can find at least one patch.
if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then
cd ${LFS_PKG_DIR}
# Decompression of a package
# First argument: package name
-# Second argument: directory where decompressing (optional)
+# Second argument: directory where decompressing (optional, defaults to LFS_TMP)
decompress_package()
{
# Checking for correct number of arguments