2022-03-27 13:30:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-10-24 19:49:47 +00:00
|
|
|
source /app/libexec/global.sh
|
2022-03-30 14:14:43 +00:00
|
|
|
|
2022-07-10 19:48:19 +00:00
|
|
|
# We moved the lockfile in /var/config/retrodeck in order to solve issue #53 - Remove in a few versions
|
|
|
|
if [ -f "$HOME/retrodeck/.lock" ]
|
|
|
|
then
|
|
|
|
mv "$HOME/retrodeck/.lock" $lockfile
|
|
|
|
fi
|
|
|
|
|
2022-05-19 14:30:43 +00:00
|
|
|
# Arguments section
|
|
|
|
|
2022-05-18 14:10:32 +00:00
|
|
|
for i in "$@"; do
|
|
|
|
case $i in
|
|
|
|
-h*|--help*)
|
2022-09-06 12:46:59 +00:00
|
|
|
echo "RetroDECK v""$version"
|
2022-05-18 14:10:32 +00:00
|
|
|
echo "
|
|
|
|
Usage:
|
|
|
|
flatpak run [FLATPAK-RUN-OPTION] net.retrodeck-retrodeck [ARGUMENTS]
|
|
|
|
|
|
|
|
Arguments:
|
2022-05-19 14:30:43 +00:00
|
|
|
-h, --help Print this help
|
|
|
|
-v, --version Print RetroDECK version
|
2022-08-04 19:40:04 +00:00
|
|
|
--info-msg Print paths and config informations
|
2022-05-19 14:30:43 +00:00
|
|
|
--reset Starts the initial RetroDECK installer (backup your data first!)
|
|
|
|
--reset-ra Resets RetroArch's config to the default values
|
|
|
|
--reset-sa Reset standalone emulator configs to the default values
|
|
|
|
--reset-tools Recreate the tools section
|
2022-05-18 14:10:32 +00:00
|
|
|
|
|
|
|
For flatpak run specific options please run: flatpak run -h
|
|
|
|
|
|
|
|
https://retrodeck.net
|
|
|
|
"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
--version*|-v*)
|
2022-09-06 12:46:59 +00:00
|
|
|
#conf_init
|
2022-08-04 19:40:04 +00:00
|
|
|
echo "RetroDECK v$version"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
--info-msg*)
|
2022-09-06 12:46:59 +00:00
|
|
|
#conf_init
|
2022-08-04 19:40:04 +00:00
|
|
|
echo "RetroDECK v$version"
|
|
|
|
echo "RetroDECK config file is in: $rd_conf"
|
|
|
|
echo "Contents:"
|
|
|
|
cat $rd_conf
|
2022-05-18 14:10:32 +00:00
|
|
|
exit
|
|
|
|
;;
|
2022-05-19 14:30:43 +00:00
|
|
|
--reset-ra*)
|
|
|
|
ra_init
|
|
|
|
shift # past argument with no value
|
|
|
|
;;
|
|
|
|
--reset-sa*)
|
|
|
|
standalones_init
|
|
|
|
shift # past argument with no value
|
|
|
|
;;
|
|
|
|
--reset-tools*)
|
|
|
|
tools_init
|
2022-05-18 14:10:32 +00:00
|
|
|
shift # past argument with no value
|
|
|
|
;;
|
2022-05-20 06:37:43 +00:00
|
|
|
--reset*)
|
|
|
|
rm -f "$lockfile"
|
|
|
|
shift # past argument with no value
|
|
|
|
;;
|
2022-05-18 14:10:32 +00:00
|
|
|
-*|--*)
|
|
|
|
echo "Unknown option $i"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2022-05-19 14:30:43 +00:00
|
|
|
# UPDATE TRIGGERED
|
2022-09-06 12:46:59 +00:00
|
|
|
# if lockfile exists
|
|
|
|
if [ -f "$lockfile" ]
|
2022-03-28 13:01:47 +00:00
|
|
|
then
|
2022-09-06 12:46:59 +00:00
|
|
|
# ...but the version doesn't match with the config file
|
2022-10-13 12:21:30 +00:00
|
|
|
if [ "$hard_version" != "$version" ];
|
2022-09-06 12:46:59 +00:00
|
|
|
then
|
2022-09-10 15:47:53 +00:00
|
|
|
echo "Config file's version is $version but the actual version is $hard_version"
|
2022-09-06 12:46:59 +00:00
|
|
|
post_update # Executing post update script
|
|
|
|
conf_write # Writing variables in the config file (sourced from global.sh)
|
|
|
|
start_retrodeck
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
# Else, LOCKFILE IS NOT EXISTING (WAS REMOVED)
|
2022-05-19 14:30:43 +00:00
|
|
|
# if the lock file doesn't exist at all means that it's a fresh install or a triggered reset
|
2022-10-13 12:21:30 +00:00
|
|
|
else
|
2022-05-19 14:30:43 +00:00
|
|
|
echo "Lockfile not found"
|
2022-07-22 17:23:38 +00:00
|
|
|
finit # Executing First/Force init
|
|
|
|
conf_write # Writing variables in the config file (sourced from global.sh)
|
2022-05-19 14:30:43 +00:00
|
|
|
exit 0
|
2022-04-02 09:21:05 +00:00
|
|
|
fi
|
2022-05-19 14:30:43 +00:00
|
|
|
|
|
|
|
# Normal Startup
|
2022-10-03 18:48:07 +00:00
|
|
|
start_retrodeck
|