Skip to content

Commit

Permalink
Fixed the update script to remember if you want it to manage the Pibo…
Browse files Browse the repository at this point in the history
…y OSD
  • Loading branch information
Brandon Hale committed Feb 6, 2021
1 parent 173d018 commit 29e0fd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
.config
24 changes: 14 additions & 10 deletions update-airplane-mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."
Expand All @@ -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
}

Expand All @@ -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
Expand Down

0 comments on commit 29e0fd0

Please sign in to comment.