aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh
diff options
context:
space:
mode:
Diffstat (limited to 'init-sh')
-rwxr-xr-xinit-sh/level4.sh9
-rw-r--r--init-sh/lib.sh11
2 files changed, 13 insertions, 7 deletions
diff --git a/init-sh/level4.sh b/init-sh/level4.sh
index a762c2d..bc18c5f 100755
--- a/init-sh/level4.sh
+++ b/init-sh/level4.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
#
@@ -80,6 +80,8 @@ echo "Setting secure level variable to 4 :"
AddRules "SECURE_LEVEL=4" /etc/profile
export SECURE_LEVEL=4
+IFS="
+"
echo -n "Disabling all service, except : {"
for service in `chkconfig --list | awk '{print $1}'`; do
if grep -qx ${service} /etc/security/msec/init-sh/server.4; then
@@ -98,7 +100,8 @@ echo -e "done.\n";
# /etc/profile
echo "Setting umask to 022 (u=rw,g=rx) for root, 077 (u=rw) for user :"
-AddRules "if [ ${UID} == 0 ]; then umask 022; else umask 077; fi" /etc/profile
+AddRules "if [ \${UID} == 0 ]; then umask 022; else umask 077; fi" /etc/profile
echo "Adding \"normal\" PATH variable :"
AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet
-AddRules "export PATH SECURE_LEVEL" /etc/profile \ No newline at end of file
+AddRules "export PATH SECURE_LEVEL" /etc/profile
+
diff --git a/init-sh/lib.sh b/init-sh/lib.sh
index d9e7107..499e81e 100644
--- a/init-sh/lib.sh
+++ b/init-sh/lib.sh
@@ -48,8 +48,8 @@ AddRules () {
fi
if ! grep -Eqx "^${string}" ${file}; then
- echo "${COMMENT}" >> ${file};
- echo "${string}" >> ${file};
+ echo -e "${COMMENT}" >> ${file};
+ echo -e "${string}" >> ${file};
fi
if [ -z ${3} ]; then
echo -e "done.\n"
@@ -64,6 +64,8 @@ CleanRules() {
mv -f ${file} /tmp/secure.tmp
touch ${file}
+ IFS="
+"
while read line; do
if [ ${ctrl} == 1 ]; then
ctrl=0
@@ -78,7 +80,8 @@ CleanRules() {
echo "${line}" >> ${file}
fi
done < /tmp/secure.tmp
-
+ IFS=" "
+
rm -f /tmp/secure.tmp
echo "done."
@@ -122,7 +125,7 @@ LiloUpdate() {
echo "Do you want a password authentication at boot time ?"
echo "Be very carefull,"
echo "this will prevent your server to reboot without an operator to enter password".
- WaitAnswer
+ WaitAnswer;
if [ "${answer}" == "yes" ]; then
echo -n "Please enter the password which will be used at boot time : "
read password