From 9f94a6e163755da713cb7efb71bd4cbb70e68580 Mon Sep 17 00:00:00 2001 From: John-Philip Johansson Date: Sun, 3 May 2020 21:10:05 +0200 Subject: [PATCH] all: Print more directories * Generalize the print-home script to print any directory tree * Useful for checking other paths, like mounts. * rpi: ~/RetroPie: See if the symlinks from $HOME/RetroPie/roms to $RETROCLOUD_RPI_MOUNT_POINT/RetroPie/roms is working * rpi: Print the mounted VM directory listing --- raspberry-pi/dev/print-all.sh | 12 ++++++++++-- raspberry-pi/download-and-run.sh | 2 +- shared/list-home.sh | 6 ------ shared/list-path.sh | 8 ++++++++ virtual-machine/setup.sh | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) delete mode 100755 shared/list-home.sh create mode 100755 shared/list-path.sh diff --git a/raspberry-pi/dev/print-all.sh b/raspberry-pi/dev/print-all.sh index 709e6ba..4c7c065 100755 --- a/raspberry-pi/dev/print-all.sh +++ b/raspberry-pi/dev/print-all.sh @@ -16,6 +16,10 @@ echo echo '##############################################################################################################################################################' echo '########## Raspberry Pi ####################################################################################################################################' +echo +echo 'PRINT: RaspberryPi ~/RetroPie all files #####################################################################################################################' +ls -la "$HOME/RetroPie" || print_fail + echo echo 'PRINT: RaspberryPi ~/.retro-cloud.env #######################################################################################################################' cat "$HOME/.retro-cloud.env" || print_fail @@ -26,7 +30,11 @@ cat "$HOME/.bashrc" || print_fail echo echo 'PRINT: RaspberryPi ~/ directory listing #####################################################################################################################' -bash -i retro-cloud-setup/dev/list-home.sh || print_fail +bash -i retro-cloud-setup/dev/list-path.sh || print_fail + +echo +echo 'PRINT: RaspberryPi /mnt (VM mount) directory listing ########################################################################################################' +bash -i retro-cloud-setup/dev/list-path.sh "$RETROCLOUD_RPI_MOUNT_POINT" || print_fail echo echo '##############################################################################################################################################################' @@ -52,7 +60,7 @@ echo 'PRINT: VM ~/.bashrc ##################################################### echo echo 'PRINT: VM ~/ directory listing ##############################################################################################################################' -./ssh-vm.sh 'bash -i retro-cloud-setup/dev/list-home.sh' || print_fail +./ssh-vm.sh 'bash -i retro-cloud-setup/dev/list-path.sh' || print_fail echo echo 'PRINT: VM Skyscraper config #################################################################################################################################' diff --git a/raspberry-pi/download-and-run.sh b/raspberry-pi/download-and-run.sh index 65297d5..25f1115 100755 --- a/raspberry-pi/download-and-run.sh +++ b/raspberry-pi/download-and-run.sh @@ -28,7 +28,7 @@ curl -fL -o "local/ssh-vm.sh" "https://raw.githubusercontent.com/seriema/retro-c mkdir -p "dev" curl -fL -o "dev/list-az-share.ps1" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/raspberry-pi/dev/list-az-share.ps1" curl -fL -o "dev/print-all.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/raspberry-pi/dev/print-all.sh" -curl -fL -o "dev/list-home.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/shared/list-home.sh" +curl -fL -o "dev/list-path.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/shared/list-path.sh" curl -fL -o "dev/run-tests.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/raspberry-pi/dev/run-tests.sh" curl -fL -o "dev/test-az-share.ps1" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/raspberry-pi/dev/test-az-share.ps1" diff --git a/shared/list-home.sh b/shared/list-home.sh deleted file mode 100755 index eb372d4..0000000 --- a/shared/list-home.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# Abort on error, error if variable is unset, and error if any pipeline element fails -set -euo pipefail - -sudo find "$HOME" | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" diff --git a/shared/list-path.sh b/shared/list-path.sh new file mode 100755 index 0000000..b52ec9a --- /dev/null +++ b/shared/list-path.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Take a parameter for what path to list. Defaults to the users home. +path=${1:-"$HOME"} + +# Abort on error, error if variable is unset, and error if any pipeline element fails +set -euo pipefail + +sudo find "$path" | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" diff --git a/virtual-machine/setup.sh b/virtual-machine/setup.sh index 704fc7f..6fdfc19 100755 --- a/virtual-machine/setup.sh +++ b/virtual-machine/setup.sh @@ -25,7 +25,7 @@ mkdir "local" curl -fL -o "local/add-scraper-credential.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/virtual-machine/local/add-scraper-credential.sh" curl -fL -o "local/run-skyscraper.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/virtual-machine/local/run-skyscraper.sh" mkdir "dev" -curl -fL -o "dev/list-home.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/shared/list-home.sh" +curl -fL -o "dev/list-path.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/shared/list-path.sh" curl -fL -o "dev/test-copy-rom.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/virtual-machine/dev/test-copy-rom.sh" curl -fL -o "dev/test-gamelist-screenscraper-failed.xml" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/virtual-machine/dev/test-gamelist-screenscraper-failed.xml" curl -fL -o "dev/test-gamelist.sh" "https://raw.githubusercontent.com/seriema/retro-cloud/$branch/virtual-machine/dev/test-gamelist.sh"