Reliable user id detection

id -u returns the effective user id
This commit is contained in:
Benjamin Börngen-Schmidt 2017-05-31 13:58:17 +02:00 committed by GitHub
parent c37813f0e4
commit 1c1fb707e2

View File

@ -17,7 +17,7 @@ arkstUserCfgFile='.arkmanager.cfg'
doUpgradeTools() {
local sudo=sudo
if [ "$UID" == 0 -o "$steamcmd_user" == "--me" ]; then
if [ $(id -u) == 0 -o "$steamcmd_user" == "--me" ]; then
sudo=
fi
@ -43,7 +43,7 @@ doUpgradeTools() {
doUpgradeToolsFromCommit(){
local sudo=sudo
if [ "$UID" == 0 -o "$steamcmd_user" == "--me" ]; then
if [ $(id -u) == 0 -o "$steamcmd_user" == "--me" ]; then
sudo=
fi
@ -138,7 +138,7 @@ doUpgradeToolsFromRelease(){
doUninstallTools() {
local sudo=sudo
if [ "$UID" == 0 -o "$steamcmd_user" == "--me" ]; then
if [ $(id -u) == 0 -o "$steamcmd_user" == "--me" ]; then
sudo=
fi