mirror of
https://github.com/Febbweiss/rclone_script.git
synced 2026-03-04 22:25:36 +00:00
changed ~/RetroPie/retropiemenu/rclone_script-menu.sh to ~/RetroPie/retropiemenu/rclone_script-redirect.sh
menu script will stay in ~/scripts/rclone_script
This commit is contained in:
@@ -676,20 +676,19 @@ function 4bCreateRCLONE_SCRIPTMenuItem ()
|
|||||||
{
|
{
|
||||||
printf "$(date +%FT%T%:z):\t4bCreateRCLONE_SCRIPTMenuItem\tSTART\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bCreateRCLONE_SCRIPTMenuItem\tSTART\n" >> "${logfile}"
|
||||||
|
|
||||||
# move menu script
|
# create redirect script
|
||||||
mv --force ~/scripts/rclone_script/rclone_script-menu.sh ~/RetroPie/retropiemenu >> "${logfile}"
|
printf "#!/bin/bash\n~/scripts/rclone_script/rclone_script-menu.sh" > ~/RetroPie/retropiemenu/rclone_script-redirect.sh
|
||||||
|
chmod +x ~/RetroPie/retropiemenu/rclone_script-redirect.sh
|
||||||
|
|
||||||
# check if menu item exists
|
# check if menu item exists
|
||||||
if [[ $(xmlstarlet sel -t -v "count(/gameList/game[path='./rclone_script-menu.sh'])" ~/.emulationstation/gamelists/retropie/gamelist.xml) -eq 0 ]]
|
if [[ $(xmlstarlet sel -t -v "count(/gameList/game[path='./rclone_script-redirect.sh'])" ~/.emulationstation/gamelists/retropie/gamelist.xml) -eq 0 ]]
|
||||||
then
|
then
|
||||||
printf "$(date +%FT%T%:z):\t4bCreateRCLONE_SCRIPTMenuItem\tNOT FOUND\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bCreateRCLONE_SCRIPTMenuItem\tNOT FOUND\n" >> "${logfile}"
|
||||||
|
|
||||||
# sed -i "/<\/gameList>/c\\\\t<game>\n\t\t<path>.\/rclone_script-menu.sh<\/path>\n\t\t<name>RCLONE_SCRIPT menu<\/name>\n\t\t<desc>Customize RCLONE_SCRIPT, start a full sync, uninstall RCLONE_SCRIPT<\/desc>\n\t\t<image></image>\n\t<\/game>\n<\/gameList>" ~/.emulationstation/gamelists/retropie/gamelist.xml
|
|
||||||
|
|
||||||
xmlstarlet ed \
|
xmlstarlet ed \
|
||||||
--inplace \
|
--inplace \
|
||||||
--subnode "/gameList" --type elem -n game -v "" \
|
--subnode "/gameList" --type elem -n game -v "" \
|
||||||
--subnode "/gameList/game[last()]" --type elem -n path -v "./rclone_script-menu.sh" \
|
--subnode "/gameList/game[last()]" --type elem -n path -v "./rclone_script-redirect.sh" \
|
||||||
--subnode "/gameList/game[last()]" --type elem -n name -v "RCLONE_SCRIPT menu" \
|
--subnode "/gameList/game[last()]" --type elem -n name -v "RCLONE_SCRIPT menu" \
|
||||||
--subnode "/gameList/game[last()]" --type elem -n desc -v "Launches a menu allowing you to start a full sync, configure RCLONE_SCRIPT or even uninstall it" \
|
--subnode "/gameList/game[last()]" --type elem -n desc -v "Launches a menu allowing you to start a full sync, configure RCLONE_SCRIPT or even uninstall it" \
|
||||||
~/.emulationstation/gamelists/retropie/gamelist.xml
|
~/.emulationstation/gamelists/retropie/gamelist.xml
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ function 4RCLONE_SCRIPT ()
|
|||||||
|
|
||||||
local found=0
|
local found=0
|
||||||
|
|
||||||
if [[ $(xmlstarlet sel -t -v "count(/gameList/game[path='./rclone_script-menu.sh'])" ~/.emulationstation/gamelists/retropie/gamelist.xml) -ne 0 ]]
|
if [[ $(xmlstarlet sel -t -v "count(/gameList/game[path='./rclone_script-redirect.sh.sh'])" ~/.emulationstation/gamelists/retropie/gamelist.xml) -ne 0 ]]
|
||||||
then
|
then
|
||||||
found=$(($found + 1))
|
found=$(($found + 1))
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ function 4RCLONE_SCRIPT ()
|
|||||||
|
|
||||||
xmlstarlet ed \
|
xmlstarlet ed \
|
||||||
--inplace \
|
--inplace \
|
||||||
--delete "//game[path='./rclone_script-menu.sh']" \
|
--delete "//game[path='./rclone_script-redirect.sh']" \
|
||||||
~/.emulationstation/gamelists/retropie/gamelist.xml
|
~/.emulationstation/gamelists/retropie/gamelist.xml
|
||||||
|
|
||||||
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItem\tREMOVED\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItem\tREMOVED\n" >> "${logfile}"
|
||||||
@@ -373,13 +373,14 @@ function 4RCLONE_SCRIPT ()
|
|||||||
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItem\tNOT FOUND\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItem\tNOT FOUND\n" >> "${logfile}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ~/RetroPie/retropiemenu/rclone_script-menu.sh ]
|
if [ -f ~/RetroPie/retropiemenu/rclone_script-redirect.sh ]
|
||||||
then
|
then
|
||||||
found=$(($found + 1))
|
found=$(($found + 1))
|
||||||
|
|
||||||
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItemScript\tFOUND\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItemScript\tFOUND\n" >> "${logfile}"
|
||||||
|
|
||||||
sudo rm ~/RetroPie/retropiemenu/rclone_script-menu.sh >> "${logfile}"
|
sudo rm ~/RetroPie/retropiemenu/rclone_script-redirect.sh >> "${logfile}"
|
||||||
|
sudo rm ~/scripts/rclone_script/rclone_script-menu.sh >> "${logfile}"
|
||||||
|
|
||||||
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItemScript\tREMOVED\n" >> "${logfile}"
|
printf "$(date +%FT%T%:z):\t4bRCLONE_SCRIPTMenuItemScript\tREMOVED\n" >> "${logfile}"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user