Added fast settings and changed root warning
This commit is contained in:
parent
f986307683
commit
a0d749b03c
1 changed files with 16 additions and 4 deletions
20
sos-git.sh
20
sos-git.sh
|
@ -274,13 +274,25 @@ function checkRootUser() {
|
||||||
echo " Please switch to a normal account, unless"
|
echo " Please switch to a normal account, unless"
|
||||||
echo " the repository asks for these permissions."
|
echo " the repository asks for these permissions."
|
||||||
echo ""
|
echo ""
|
||||||
echo " To disable this warning, create a file at"
|
echo " To disable this warning, create a file"
|
||||||
echo " \"$HOME/.sostools/git/sos-git.conf.d/norootwarning.conf\" or"
|
echo " at \"$HOME/.sostools/git/norootwarn\""
|
||||||
echo " \"/etc/sostools/git/sos-git.conf.d/norootwarning.conf\" with"
|
echo " or \"/etc/sostools/git/norootwarn\""
|
||||||
echo " the content \"SOSGIT_NOROOTWARNING=true\"."
|
fi
|
||||||
|
}
|
||||||
|
function checkFastSettings() {
|
||||||
|
if [ -f "$HOME/.sostools/git/norootwarn" ] || [ -d "$HOME/.sostools/git/norootwarn" ]; then
|
||||||
|
rm -rf "$HOME/.sostools/git/norootwarn"
|
||||||
|
echo -e "# This file has been generated by sos-git\n# because of the use of fast settings.\nSOSGIT_NOROOTWARN=true" &> "$HOME/.sostools/git/sos-git.conf.d/norootwarning.conf"
|
||||||
|
fi
|
||||||
|
if [ "$(whoami)" == "root" ]; then
|
||||||
|
if [ -f "/etc/sostools/git/norootwarn" ] || [ -d "/etc/sostools/git/norootwarn" ]; then
|
||||||
|
rm -rf "/etc/sostools/git/norootwarn"
|
||||||
|
echo -e "# This file has been generated by sos-git\n# because of the use of fast settings.\nSOSGIT_NOROOTWARN=true" &> "/etc/sostools/git/sos-git.conf.d/norootwarning.conf"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
loadDefaultConfiguration
|
loadDefaultConfiguration
|
||||||
|
checkFastSettings
|
||||||
loadSystemConfiguration
|
loadSystemConfiguration
|
||||||
loadUserConfiguration
|
loadUserConfiguration
|
||||||
doSystemSetup
|
doSystemSetup
|
||||||
|
|
Reference in a new issue