diff --git a/Dockerfile b/Dockerfile index da0172c..f7b8bdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM debian:bookworm-slim -RUN apt update && apt upgrade -y && apt install rsync parallel jq COPY . /app - WORKDIR /app -CMD bash /app/file-o-bot.sh +RUN bash ./install.sh +CMD bash /app/file-o-bot diff --git a/file-o-bot b/file-o-bot index 2484035..5fdb9ab 100755 --- a/file-o-bot +++ b/file-o-bot @@ -71,7 +71,7 @@ fi # Compile storage paths from all the movements readarray -t STORAGE_PATHS \ - < <( jq -r '.movements[] | .sourcePath, .destinationPath' "${MOVEMENT_JSON_PATH}" | xargs -n 1 -I {} readlink -e "{}" | sort --unique ) + < <( jq -r '.movements[] | .sourcePath, .destinationPath' "${MOVEMENT_JSON_PATH}" | xargs -I {} readlink -e "{}" | sort --unique ) STORAGE_PATHS_LEN=${#STORAGE_PATHS[@]} # Verify that all storage paths work diff --git a/install.sh b/install.sh index 5eeff91..2f14936 100755 --- a/install.sh +++ b/install.sh @@ -5,11 +5,11 @@ set -euo . /etc/os-release if [[ $ID == "debian" ]]; then - apt-get install -y rsync jq parallel + apt update && apt-get install -y rsync jq parallel #elif [[ $ID == "centos" ]]; then # yum -y install jq rsync parallel elif [[ $ID_LIKE == "arch" ]]; then - pacman -S parallel jq rsync + pacman -Syyu && pacman -S parallel jq rsync else printf "Distro not found. Exiting." exit 1