diff options
author | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-14 13:11:00 +0000 |
---|---|---|
committer | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-14 13:11:00 +0000 |
commit | 4dc0240a5cf80501ea30478015f5796c91c57d30 (patch) | |
tree | d2456bf27818353641a17d90da924373bf8faa22 /init-sh/lib.sh | |
parent | 667bf979ccc661bc6c935ff0dac4be234414fb51 (diff) | |
download | msec-4dc0240a5cf80501ea30478015f5796c91c57d30.tar msec-4dc0240a5cf80501ea30478015f5796c91c57d30.tar.gz msec-4dc0240a5cf80501ea30478015f5796c91c57d30.tar.bz2 msec-4dc0240a5cf80501ea30478015f5796c91c57d30.tar.xz msec-4dc0240a5cf80501ea30478015f5796c91c57d30.zip |
*** empty log message ***
Diffstat (limited to 'init-sh/lib.sh')
-rw-r--r-- | init-sh/lib.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/init-sh/lib.sh b/init-sh/lib.sh index ec93c61..ee046a9 100644 --- a/init-sh/lib.sh +++ b/init-sh/lib.sh @@ -43,6 +43,35 @@ AddRules () { fi } +AddBegRules() { + string=$1 + file=$2 + quiet=$3 + ctrl=0 + + if [[ -z ${string} ]]; then + return; + fi + + if [[ -z ${quiet} ]]; then + echo "Modifying config in ${file}..." + fi + + mv ${file} /tmp/secure.tmp + + if ! grep -Eqx "^${string}" /tmp/secure.tmp; then + echo -e "${COMMENT}" >> ${file}; + echo -e "${string}" >> ${file}; + fi + + cat /tmp/secure.tmp >> ${file} + + if [[ -z ${3} ]]; then + echo -e "done.\n" + fi +} + + CleanRules() { file=$1 ctrl=0 |