Fixed crash bug if yad is not installed and agm is launched from a gui. Insure AGM is not ran as the root users. If people who really should know better still need training wheels, actual newbies might need the protection as well.
This commit is contained in:
@@ -8,15 +8,26 @@ alert() {
|
||||
}
|
||||
|
||||
check_requirements() {
|
||||
# Make sure the minimum of curl, sox, wine, and winetricks are installed or fex-emu on aarch64
|
||||
# Make sure this is not ran as root
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
echo "Please do not run ${0##*/} as root."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Make sure the minimum dependencies are installed
|
||||
if [[ "$(uname -m)" == "aarch64" ]]; then
|
||||
minimumDependencies=("FEXLoader")
|
||||
wine="FEXLoader -- /usr/bin/wine"
|
||||
else
|
||||
minimumDependencies=("curl" "sox" "wine")
|
||||
minimumDependencies=(
|
||||
"curl"
|
||||
"dialog"
|
||||
"sox"
|
||||
"wine"
|
||||
)
|
||||
fi
|
||||
for i in "${minimumDependencies[@]}" ; do
|
||||
if ! command -v $i &> /dev/null ; then
|
||||
if ! command -v "$i" &> /dev/null ; then
|
||||
echo "Please install $i before continuing."
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user