Skip to content

Commit

Permalink
Fixed issue in script that installed moonlight menu
Browse files Browse the repository at this point in the history
  • Loading branch information
joelghill committed Dec 8, 2017
1 parent a364a69 commit ca31b89
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 147 deletions.
106 changes: 53 additions & 53 deletions Install.sh
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
#!/bin/bash

echo -e "\n****************************************************************"
echo -e "Welcome to the Moonlight Installer Script for RetroPie"
echo -e "****************************************************************\n"
echo -e "Select an option:"
echo -e " * 1: Complete Install and Setup"
echo -e " * 2: Install Moonlight"
echo -e " * 3: Pair Moonlight to PC"
echo -e " * 4: Install Moonlight Menu in RetroPie"
echo -e " * 5: Install Moonlight Refresh Script in RetroPie"
echo -e " * 6: Install Moonlight themes"
echo -e " * 7: Remove Launch Scripts"
echo -e " * 8: Exit"

read NUM
case $NUM in
1)
sudo bash ./Install_moonlight.sh
sudo bash ./Pair_moonlight.sh
sudo bash ./Install_moonlight_menu.sh
sudo bash ./Install_Scripts.sh
sudo bash ./Install_themes.sh
;;
2)
sudo bash ./Install_moonlight.sh
sudo bash ./Install.sh
;;
3)
sudo bash ./Pair_moonlight.sh
sudo bash ./Install.sh
;;
4)
sudo bash ./Install_moonlight_menu.sh
sudo bash ./Install.sh
;;
5)
sudo bash ./Install_Scripts.sh
sudo bash ./Install.sh
;;
6)
sudo bash ./Install_themes.sh
sudo bash ./Install.sh
;;
7)
echo -e "\nRemoving all Moonlight launch scripts..."
rm -rf /home/pi/RetroPie/roms/moonlight
sudo bash ./Install.sh
;;
8)
exit 1
;;
*) echo "INVALID NUMBER!" ;;
#!/bin/bash

echo -e "\n****************************************************************"
echo -e "Welcome to the Moonlight Installer Script for RetroPie"
echo -e "****************************************************************\n"
echo -e "Select an option:"
echo -e " * 1: Complete Install and Setup"
echo -e " * 2: Install Moonlight"
echo -e " * 3: Pair Moonlight to PC"
echo -e " * 4: Install Moonlight Menu in RetroPie"
echo -e " * 5: Install Moonlight Refresh Script in RetroPie"
echo -e " * 6: Install Moonlight themes"
echo -e " * 7: Remove Launch Scripts"
echo -e " * 8: Exit"

read NUM
case $NUM in
1)
sudo bash ./Install_moonlight.sh
sudo bash ./Pair_moonlight.sh
sudo bash ./Install_moonlight_menu.sh
sudo bash ./Install_Scripts.sh
sudo bash ./Install_themes.sh
;;
2)
sudo bash ./Install_moonlight.sh
sudo bash ./Install.sh
;;
3)
sudo bash ./Pair_moonlight.sh
sudo bash ./Install.sh
;;
4)
sudo bash ./Install_moonlight_menu.sh
sudo bash ./Install.sh
;;
5)
sudo bash ./Install_Scripts.sh
sudo bash ./Install.sh
;;
6)
sudo bash ./Install_themes.sh
sudo bash ./Install.sh
;;
7)
echo -e "\nRemoving all Moonlight launch scripts..."
rm -rf /home/pi/RetroPie/roms/moonlight
sudo bash ./Install.sh
;;
8)
exit 1
;;
*) echo "INVALID NUMBER!" ;;
esac
40 changes: 20 additions & 20 deletions Install_Scripts.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/bash

echo -e "\nCreating Refresh script in Moonlight..."

if [ -d /home/pi/RetroPie/roms/moonlight ]
then
rm -rf /home/pi/RetroPie/roms/moonlight
fi

mkdir -p /home/pi/RetroPie/roms/moonlight
chmod 775 /home/pi/RetroPie/roms/moonlight
chown pi:pi /home/pi/RetroPie/roms/moonlight

chmod -x+ Refresh.sh

/bin/cp ./Refresh.sh /home/pi/RetroPie/roms/moonlight/Refresh.sh
/bin/cp ./GenerateGamesList.py /home/pi/RetroPie/roms/moonlight/GenerateGamesList.py

echo -e "Refresh script has been added to RetroPie\n"
echo -e "After loading RetroPie, use the \"Refresh\" rom listed in the Moonlight system.\n"
#!/bin/bash

echo -e "\nCreating Refresh script in Moonlight..."

if [ -d /home/pi/RetroPie/roms/moonlight ]
then
rm -rf /home/pi/RetroPie/roms/moonlight
fi

mkdir -p /home/pi/RetroPie/roms/moonlight
chmod 775 /home/pi/RetroPie/roms/moonlight
chown pi:pi /home/pi/RetroPie/roms/moonlight

chmod -x+ Refresh.sh

/bin/cp ./Refresh.sh /home/pi/RetroPie/roms/moonlight/Refresh.sh
/bin/cp ./GenerateGamesList.py /home/pi/RetroPie/roms/moonlight/GenerateGamesList.py

echo -e "Refresh script has been added to RetroPie\n"
echo -e "After loading RetroPie, use the \"Refresh\" rom listed in the Moonlight system.\n"
54 changes: 27 additions & 27 deletions Install_moonlight.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/bin/bash

echo -e "\nAdding Moonlight to Sources List..."

if grep -q "deb http://archive.itimmer.nl/raspbian/moonlight jessie main" /etc/apt/sources.list; then
echo -e "NOTE: Moonlight Source Exists - Skipping"
else
echo -e "Adding Moonlight to Sources List"
echo "deb http://archive.itimmer.nl/raspbian/moonlight jessie main" >> /etc/apt/sources.list
fi

echo -e "\nFetching and installing the GPG key....\n"

if [ -f /home/pi/itimmer.gpg ]
then
echo -e "NOTE: GPG Key Exists - Skipping"
else
wget http://archive.itimmer.nl/itimmer.gpg
chown pi:pi /home/pi/itimmer.gpg
apt-key add itimmer.gpg
fi

echo -e "\nUpdating System..."
apt-get update -y

echo -e "\nInstalling Moonlight..."
apt-get install moonlight-embedded -y
#!/bin/bash

echo -e "\nAdding Moonlight to Sources List..."

if grep -q "deb http://archive.itimmer.nl/raspbian/moonlight jessie main" /etc/apt/sources.list; then
echo -e "NOTE: Moonlight Source Exists - Skipping"
else
echo -e "Adding Moonlight to Sources List"
echo "deb http://archive.itimmer.nl/raspbian/moonlight jessie main" >> /etc/apt/sources.list
fi

echo -e "\nFetching and installing the GPG key....\n"

if [ -f /home/pi/itimmer.gpg ]
then
echo -e "NOTE: GPG Key Exists - Skipping"
else
wget http://archive.itimmer.nl/itimmer.gpg
chown pi:pi /home/pi/itimmer.gpg
apt-key add itimmer.gpg
fi

echo -e "\nUpdating System..."
apt-get update -y

echo -e "\nInstalling Moonlight..."
apt-get install moonlight-embedded -y
echo -e "\nMoonlight Installed!"
45 changes: 20 additions & 25 deletions Install_moonlight_menu.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
#!/bin/bash

echo -e "\nCreating Moonlight Menu for RetroPie..."

CONFIG=$(<./menu_config.txt)
DIRECTORY=/home/pi/.emulationstation/es_systems.cfg

if [ -f $DIRECTORY ]
then
echo -e "Removing Duplicate Systems File"
rm $DIRECTORY
fi

echo -e "Copying Systems Config File"
cp /etc/emulationstation/es_systems.cfg $DIRECTORY

if grep -q "$CONFIG" $DIRECTORY; then
echo -e "NOTE: Moonlight Entry Exists - Skipping"
else
echo -e "Adding Steam to Systems"
sed
sudo sed -i -e 's|</systemList>| /r ./menu_config.txt' $DIRECTORY
fi

echo -e "\nMoonlight menue added to RetroPie..."
#!/bin/bash

echo -e "\nCreating Moonlight Menu for RetroPie..."

CONFIG=$(<./menu_config.txt)
DIRECTORY=/home/pi/.emulationstation/es_systems.cfg

if [ -f $DIRECTORY ]
then
echo -e "Removing Duplicate Systems File"
rm $DIRECTORY
fi

echo -e "Copying Systems Config File"
cp /etc/emulationstation/es_systems.cfg $DIRECTORY

echo -e "Adding Moonlight to Systems"
sudo sed -i -e 's|</systemList>| <system>\n <name>steam</name>\n <fullname>Steam</fullname>\n <path>~/RetroPie/roms/moonlight</path>\n <extension>.sh .SH</extension>\n <command>bash %ROM%</command>\n <platform>pc</platform>\n <theme>moonlight</theme>\n </system>\n</systemList>|g' $DIRECTORY

echo -e "\nMoonlight menu added to RetroPie..."
12 changes: 6 additions & 6 deletions Install_themes.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo -e "\nInstalling Moonlight compatible themes..."

cp -R ./themes /etc/emulationstation/

#!/bin/bash

echo -e "\nInstalling Moonlight compatible themes..."

cp -R ./themes /etc/emulationstation/

echo -e "\nThemes installed"
14 changes: 7 additions & 7 deletions Pair_moonlight.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

echo -e "\nPairing Moonlight with another PC...\n"
echo -e "Once you have input your PC's IP Address below, you will be given a PIN"
echo -e "Input this on the PC to pair with Moonlight. \n"
read -p "Input PC's IP Address here :`echo $'\n> '`" ip
sudo -u pi moonlight pair $ip
#!/bin/bash

echo -e "\nPairing Moonlight with another PC...\n"
echo -e "Once you have input your PC's IP Address below, you will be given a PIN"
echo -e "Input this on the PC to pair with Moonlight. \n"
read -p "Input PC's IP Address here :`echo $'\n> '`" ip
sudo -u pi moonlight pair $ip
echo -e "Pair Process Complete."
18 changes: 9 additions & 9 deletions menu_config.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<system>
<name>steam</name>
<fullname>Steam</fullname>
<path>~/RetroPie/roms/moonlight</path>
<extension>.sh .SH</extension>
<command>bash %ROM%</command>
<platform>pc</platform>
<theme>moonlight</theme>
</system>
<system>
<name>steam</name>
<fullname>Steam</fullname>
<path>~/RetroPie/roms/moonlight</path>
<extension>.sh .SH</extension>
<command>bash %ROM%</command>
<platform>pc</platform>
<theme>moonlight</theme>
</system>
</systemList>

0 comments on commit ca31b89

Please sign in to comment.