diff options
Diffstat (limited to 'init-sh')
-rwxr-xr-x | init-sh/level1.sh | 12 | ||||
-rwxr-xr-x | init-sh/level2.sh | 6 | ||||
-rwxr-xr-x | init-sh/level3.sh | 6 | ||||
-rwxr-xr-x | init-sh/level4.sh | 7 | ||||
-rwxr-xr-x | init-sh/level5.sh | 5 | ||||
-rw-r--r-- | init-sh/lib.sh | 4 |
6 files changed, 25 insertions, 15 deletions
diff --git a/init-sh/level1.sh b/init-sh/level1.sh index 2fef869..fdeca03 100755 --- a/init-sh/level1.sh +++ b/init-sh/level1.sh @@ -56,11 +56,19 @@ echo -e "done.\n" # /etc/profile echo "Setting secure level variable to 1 :" AddRules "SECURE_LEVEL=1" /etc/profile -echo "Setting umask to 002 (user = rw, group = rw, o = r) :" +echo "Setting umask to 002 (u=rw,g=rw,o=r) :" AddRules "umask 002" /etc/profile echo "Adding \"non secure\" PATH variable :" -AddRules "PATH=\$PATH:/usr/X11R6/bin:." /etc/profile +AddRules "PATH=\$PATH:/usr/X11R6/bin:." /etc/profile quiet +AddRules "export PATH SECURE_LEVEL" /etc/profile # Group echo "Adding \"${USERNAME} to audio group :" usermod -G audio "${USERNAME}" + + + + + + + diff --git a/init-sh/level2.sh b/init-sh/level2.sh index ec80c5d..1c4ebd3 100755 --- a/init-sh/level2.sh +++ b/init-sh/level2.sh @@ -56,11 +56,11 @@ echo -e "done.\n" # /etc/profile echo "Setting secure level variable to 2 :" AddRules "SECURE_LEVEL=2" /etc/profile -echo "Setting umask to 022 (user = rw, group = r, o = r) :" +echo "Setting umask to 022 (u=rw,g=r,o=r) :" AddRules "umask 022" /etc/profile echo "Adding \"normal\" PATH variable :" -AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile - +AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet +AddRules "export PATH SECURE_LEVEL" /etc/profile # Group echo "Adding \"${USERNAME} to audio group :" usermod -G audio "${USERNAME}" diff --git a/init-sh/level3.sh b/init-sh/level3.sh index 29ea9b7..d45c608 100755 --- a/init-sh/level3.sh +++ b/init-sh/level3.sh @@ -63,8 +63,8 @@ echo -e "done.\n" # /etc/profile echo "Setting secure level variable to 3 :" AddRules "SECURE_LEVEL=3" /etc/profile -echo "Setting umask to 022 (user = rw, group = r, o = r) :" +echo "Setting umask to 022 (u=rw,g=r,o=r) :" AddRules "umask 022" /etc/profile echo "Adding a \"normal\" PATH variable : " -AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile - +AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet +AddRules "export PATH SECURE_LEVEL" /etc/profile diff --git a/init-sh/level4.sh b/init-sh/level4.sh index 421c5e0..f555a51 100755 --- a/init-sh/level4.sh +++ b/init-sh/level4.sh @@ -97,7 +97,8 @@ done echo -e "done.\n"; # /etc/profile -echo "Setting umask to 077 (user = rw) :" -AddRules "umask 077" /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" echo "Adding \"normal\" PATH variable :" -AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile +AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet +AddRules "export PATH SECURE_LEVEL" /etc/profile
\ No newline at end of file diff --git a/init-sh/level5.sh b/init-sh/level5.sh index 0b60c2d..3e1704c 100755 --- a/init-sh/level5.sh +++ b/init-sh/level5.sh @@ -93,10 +93,11 @@ done echo -e "done.\n"; # /etc/profile -echo "Setting umask to 077 (user = rw) :" +echo "Setting umask to 077 (u=rw) :" AddRules "umask 077" /etc/profile echo "Adding \"normal\" PATH variable :" -AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile +AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet +AddRules "export PATH SECURE_LEVEL" /etc/profile echo echo "You are now running your system in security level 5," diff --git a/init-sh/lib.sh b/init-sh/lib.sh index 81c62c0..262b1db 100644 --- a/init-sh/lib.sh +++ b/init-sh/lib.sh @@ -47,7 +47,7 @@ AddRules () { echo "Modifying config in ${file}..." fi - if ! grep -qx "${string}" ${file}; then + if ! grep -Eqx "^${string}" ${file}; then echo "${COMMENT}" >> ${file}; echo "${string}" >> ${file}; fi @@ -60,7 +60,7 @@ CleanRules() { file=$1 ctrl=0 - echo -en "\t- Cleaning msec appended line in ${file} : " + echo -en "\t- Cleaning msec appended line in ${file} : " mv -f ${file} /tmp/secure.tmp touch ${file} |