From 29e0fd0967dc7be43af621ebb09679a5b2058b88 Mon Sep 17 00:00:00 2001 From: Brandon Hale Date: Sat, 6 Feb 2021 18:03:01 -0500 Subject: [PATCH] Fixed the update script to remember if you want it to manage the Piboy OSD --- .gitignore | 2 ++ update-airplane-mode.sh | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..779735c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +.config \ No newline at end of file diff --git a/update-airplane-mode.sh b/update-airplane-mode.sh index 9d33c81..2c54f19 100755 --- a/update-airplane-mode.sh +++ b/update-airplane-mode.sh @@ -6,10 +6,13 @@ # This will look to see if you have the airplane-mode scripts installed, and do it for you automagically. # It also doubles as an updater, so you can just run this from the emulationstation menu and it will update the scripts seamlessly for you. +# We are not using a variable to tell if you want the Piboy DMG OSD to be managed by this script. We are using .config file in ~/RetroPie/retropiemenu/wireless + # RAM=Retropie-airplane-mode. It does not stand for random-access memory. RAM_DIR=~/RetroPie/retropiemenu/wireless RAM_OLD_DIR=~/RetroPie/roms/ports/wireless +RAM_PIBOY_OSD=$(cat ~/RetroPie/retropiemenu/wireless/.config) RAM_INSTALL() { git clone https://github.com/brandflake11/Retropie-Airplane-Mode.git ~/RetroPie/retropiemenu/wireless @@ -40,14 +43,14 @@ RAM_PIBOY_QUESTIONS() { read -p "Do you want the RetroPie-Airplane-Mode scripts to manage your osd icons? [y]es, [n]o: " RAM_PIBOY_RESPONSE if [[ $RAM_PIBOY_RESPONSE == 'y' || $RAM_PIBOY_RESPONSE == 'Y' || $RAM_PIBOY_RESPONSE == "yes" ]] then - export RAM_PIBOY_OSD=1 - echo "export RAM_PIBOY_OSD=1" >> ~/.bashrc - echo "Copying variable to bashrc to equal 1" + echo "RAM_PIBOY_OSD=1" > $RAM_DIR/.config + # echo "export RAM_PIBOY_OSD=1" >> ~/.bashrc + echo "Setting configuration..." elif [[ $RAM_PIBOY_RESPONSE == "n" || $RAM_PIBOY_RESPONSE == "N" || $RAM_PIBOY_RESPONSE == "no" ]] then - export RAM_PIBOY_OSD=0 - echo "export RAM_PIBOY_OSD=0" >> ~/.bashrc - echo "Copying variable to bashrc to equal 0" + echo "RAM_PIBOY_OSD=0" > $RAM_DIR/.config + # echo "export RAM_PIBOY_OSD=0" >> ~/.bashrc + echo "Setting configuration.." echo else echo "Error, not a valid response." @@ -56,12 +59,12 @@ RAM_PIBOY_QUESTIONS() { echo "If you don't know what this means, you have nothing to worry about." echo echo "If at any time you don't want RetroPie-Airplane-Mode to manage your osd, simply" - echo "change this line in your .bashrc in your home directory from:" - echo "export RAM_PIBOY_OSD=1" + echo "change this line in ./.config in this directory from:" + echo "RAM_PIBOY_OSD=1" echo "to:" - echo "export RAM_PIBOY_OSD=0" + echo "RAM_PIBOY_OSD=0" echo - echo "Make sure you reboot for the osd choice to take effect." + # echo "Make sure you reboot for the osd choice to take effect." fi } @@ -73,6 +76,7 @@ RAM_PIBOY_CHECK() { fi } +echo $RAM_PIBOY_OSD ## Check to see if the old RetroPie-airplane-mode exists and move it/update it if [ -d $RAM_OLD_DIR ] then