aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh/lib.sh
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>1999-12-15 17:21:06 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>1999-12-15 17:21:06 +0000
commitf7724d679b59540db2af2a17eb3ee169dad870d5 (patch)
tree7c61660ae07f680cb15c69687ca3d4db031bd58f /init-sh/lib.sh
parentf8210b92de7849d956c817f86face6175ab51932 (diff)
downloadmsec-f7724d679b59540db2af2a17eb3ee169dad870d5.tar
msec-f7724d679b59540db2af2a17eb3ee169dad870d5.tar.gz
msec-f7724d679b59540db2af2a17eb3ee169dad870d5.tar.bz2
msec-f7724d679b59540db2af2a17eb3ee169dad870d5.tar.xz
msec-f7724d679b59540db2af2a17eb3ee169dad870d5.zip
*** empty log message ***
Diffstat (limited to 'init-sh/lib.sh')
-rw-r--r--init-sh/lib.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/init-sh/lib.sh b/init-sh/lib.sh
index e519ad8..124fc63 100644
--- a/init-sh/lib.sh
+++ b/init-sh/lib.sh
@@ -57,10 +57,10 @@ AddBegRules() {
echo "Modifying config in ${file}..."
fi
- mv ${file} /tmp/secure.tmp
+ cp -f ${file} /tmp/secure.tmp
if ! grep -Eqx "^${string}" /tmp/secure.tmp; then
- echo -e "${COMMENT}" >> ${file};
+ echo -e "${COMMENT}" > ${file};
echo -e "${string}" >> ${file};
fi
@@ -81,8 +81,7 @@ CleanRules() {
fi
echo -en "\t- Cleaning msec appended line in ${file} : "
- mv -f ${file} /tmp/secure.tmp
- touch ${file}
+ cp -f ${file} /tmp/secure.tmp
while read line; do
if [[ ${ctrl} == 1 ]]; then
@@ -95,7 +94,7 @@ CleanRules() {
fi
if [[ ${ctrl} == 0 ]]; then
- echo "${line}" >> ${file}
+ echo "${line}" > ${file}
fi
done < /tmp/secure.tmp
@@ -113,12 +112,11 @@ CommentUserRules() {
echo -en "\t- Cleaning user appended line in ${file} : "
- mv -f ${file} /tmp/secure.tmp
- touch ${file}
-
+ cp -f ${file} /tmp/secure.tmp
+
while read line; do
if ! echo "${line}" | grep -qE "^#"; then
- echo "# ${line}" >> ${file}
+ echo "# ${line}" > ${file}
fi
done < /tmp/secure.tmp
@@ -158,10 +156,10 @@ LiloUpdate() {
fi
if [[ ! -z "${password}" ]]; then
- mv /etc/lilo.conf /tmp/secure.tmp
+ cp -f /etc/lilo.conf /tmp/secure.tmp
while read line; do
if ! echo "${line}" | grep -q "password"; then
- echo "${line}" >> /etc/lilo.conf
+ echo "${line}" > /etc/lilo.conf
fi
done < /tmp/secure.tmp