Optimized some for file loops and changed chmodConf

This commit is contained in:
JeremyStarTM 2022-08-14 21:05:34 +02:00
parent d4f21f5208
commit 40de0a7f1a

View file

@ -191,7 +191,7 @@ function loadSystemConfiguration() {
echo -e "$SOSGIT_EXITSTRING" &> /etc/sostools/git/sos-git.conf echo -e "$SOSGIT_EXITSTRING" &> /etc/sostools/git/sos-git.conf
fi fi
if [ -d "/etc/sostools/git/sos-git.conf.d/" ]; then if [ -d "/etc/sostools/git/sos-git.conf.d/" ]; then
for file in $(/bin/ls -Aw 1 "/etc/sostools/git/sos-git.conf.d/");do for file in $(/bin/ls --color=never -w 1 "/etc/sostools/git/sos-git.conf.d/");do
source "/etc/sostools/git/sos-git.conf.d/${file}" source "/etc/sostools/git/sos-git.conf.d/${file}"
done done
fi fi
@ -210,7 +210,7 @@ function loadUserConfiguration() {
fi fi
fi fi
if [ -d "$HOME/.sostools/git/sos-git.conf.d/" ]; then if [ -d "$HOME/.sostools/git/sos-git.conf.d/" ]; then
for file in $(/bin/ls -Aw 1 "$HOME/.sostools/git/sos-git.conf.d/");do for file in $(/bin/ls --color=never -w 1 "$HOME/.sostools/git/sos-git.conf.d/");do
source "$HOME/.sostools/git/sos-git.conf.d/${file}" source "$HOME/.sostools/git/sos-git.conf.d/${file}"
done done
fi fi
@ -292,8 +292,14 @@ function checkFastSettings() {
fi fi
} }
function chmodConfiguration() { function chmodConfiguration() {
chmod +x "$HOME/.sostools/git/sos-git.conf" "$HOME/.sostools/git/sos-git.conf.d/*.conf" &> /dev/null chmod +x "$HOME/.sostools/git/sos-git.conf" &> /dev/null
chmod +x "/etc/sostools/git/sos-git.conf" "/etc/sostools/git/sos-git.conf.d/*.conf" &> /dev/null for file in $(ls --color=never -w 1 "$HOME/.sostools/git/sos-git.conf.d/*.conf"); do
chmod +x "$HOME/.sostools/git/sos-git.conf.d/$file"
done
chmod +x "/etc/sostools/git/sos-git.conf" &> /dev/null
for file in $(ls --color=never -w 1 "/etc/sostools/git/sos-git.conf.d/*.conf"); do
chmod +x "/etc/sostools/git/sos-git.conf.d/$file"
done
} }
loadDefaultConfiguration loadDefaultConfiguration
checkFastSettings checkFastSettings