fix sudo on install

This commit is contained in:
Dragoon Dorise 2024-02-09 08:49:41 +01:00
parent dc9803a729
commit 14f2e587d6

View file

@ -453,11 +453,9 @@ if [ "$system" == "chimeraos" ]; then
fi
createDesktopIcons
if [ "$doInstallHomeBrewGames" == "true" ]; then
emuDeckInstallHomebrewGames
fi
#
##
@ -465,39 +463,39 @@ fi
##
#
if [ "$system" != "darwin" ]; then
#if [ "$system" != "darwin" ]; then
#If the user is not using chimera we assume he has no pass ( deck user )
if [ "$system" = "chimeraos" ]; then
password="gamer"
else
password="Decky!"
fi
#We try to create a temp password
pwstatus=0
yes "$password" | passwd $(whoami) && "$password" | sudo -v -S &>/dev/null && pwstatus=1 || echo "sudo password was incorrect" #refresh sudo cache
# We can't create the pass?we ask for it
if [ $pwstatus = 0 ]; then
read -r password <<< $(Plugins_checkPassword "newPass")
fi
# if [ "$system" = "chimeraos" ]; then
# password="gamer"
# else
# password="Decky!"
# fi
# #We try to create a temp password
# pwstatus=0
# yes "$password" | passwd $(whoami) && "$password" | sudo -v -S &>/dev/null && pwstatus=1 || echo "sudo password was incorrect" #refresh sudo cache
# # We can't create the pass?we ask for it
# if [ $pwstatus = 0 ]; then
# read -r password <<< $(Plugins_checkPassword "newPass")
# fi
#
# if ( echo "$password" | sudo -S -k true ); then
# echo $password | sudo -v -S && {
# Plugins_installEmuDecky $password
# if [ "$system" == "chimeraos" ]; then
# Plugins_installPowerControl $password
# else
# Plugins_installPowerTools $password
# fi
# Plugins_installPluginLoader $password
# }
# fi
#
# if [ $password = "Decky!" ]; then
# Plugins_install_cleanup "Decky!"
# fi
if ( echo "$password" | sudo -S -k true ); then
echo $password | sudo -v -S && {
Plugins_installEmuDecky $password
if [ "$system" == "chimeraos" ]; then
Plugins_installPowerControl $password
else
Plugins_installPowerTools $password
fi
Plugins_installPluginLoader $password
}
fi
if [ $password = "Decky!" ]; then
Plugins_install_cleanup "Decky!"
fi
fi
#fi
#Plugins_installSteamDeckGyroDSU