From 40de0a7f1af4efd9843583dcaad10e6ac9fa3d28 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 14 Aug 2022 21:05:34 +0200 Subject: [PATCH] Optimized some for file loops and changed chmodConf --- sos-git.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sos-git.sh b/sos-git.sh index a99605e..590352a 100755 --- a/sos-git.sh +++ b/sos-git.sh @@ -191,7 +191,7 @@ function loadSystemConfiguration() { echo -e "$SOSGIT_EXITSTRING" &> /etc/sostools/git/sos-git.conf fi 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}" done fi @@ -210,7 +210,7 @@ function loadUserConfiguration() { fi fi 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}" done fi @@ -292,8 +292,14 @@ function checkFastSettings() { fi } function chmodConfiguration() { - chmod +x "$HOME/.sostools/git/sos-git.conf" "$HOME/.sostools/git/sos-git.conf.d/*.conf" &> /dev/null - chmod +x "/etc/sostools/git/sos-git.conf" "/etc/sostools/git/sos-git.conf.d/*.conf" &> /dev/null + chmod +x "$HOME/.sostools/git/sos-git.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 checkFastSettings