aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh
diff options
context:
space:
mode:
Diffstat (limited to 'init-sh')
-rw-r--r--init-sh/lib.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/init-sh/lib.sh b/init-sh/lib.sh
index b429fec..302cebc 100644
--- a/init-sh/lib.sh
+++ b/init-sh/lib.sh
@@ -46,12 +46,13 @@ CleanRules() {
file=$1
ctrl=0
+ if [ ! -f ${file} ]; then
+ return;
+ fi
echo -en "\t- Cleaning msec appended line in ${file} : "
mv -f ${file} /tmp/secure.tmp
touch ${file}
- IFS="
-"
while read line; do
if [ ${ctrl} == 1 ]; then
ctrl=0
@@ -66,7 +67,6 @@ CleanRules() {
echo "${line}" >> ${file}
fi
done < /tmp/secure.tmp
- IFS=" "
rm -f /tmp/secure.tmp
@@ -76,6 +76,10 @@ CleanRules() {
CommentUserRules() {
file=$1
+ if [ ! -f ${file} ]; then
+ return;
+ fi
+
echo -en "\t- Cleaning user appended line in ${file} : "
mv -f ${file} /tmp/secure.tmp
@@ -184,11 +188,15 @@ usermod -G xgrp xfs
# so we delete ( temporarily ) audio user.
if [ ! -f /tmp/secure.DrakX ]; then
- for user in ${DRAKX_USERS}; do
- /etc/security/msec/init-sh/grpuser --del audio "${user}"; then
- done
+ if [ ! -z ${DRAKX_USERS} ]; then
+ for user in ${DRAKX_USERS}; do
+ /etc/security/msec/init-sh/grpuser --del audio "${user}"
+ done
+ fi
else
+ if [ ! -z ${DRAKX_USERS} ]; then
AddRules "${DRAKX_USERS}" /etc/security/msec/security.conf
+ fi
fi