#!/usr/bin/env bash set -e SMB_BASE="smb://vlda-01/software/Games/dosbox" GAME_ZIPS="stuntcar.zip t7g.zip" if [ -n "$(ls -A "${GAMES_HOME}" 2>/dev/null)" ]; then echo "Games already present in ${GAMES_HOME}, skipping fetch" exit 0 fi echo "Fetching games into ${GAMES_HOME}..." TMPDIR=$(mktemp -d) trap 'rm -rf "${TMPDIR}"' EXIT cd "${TMPDIR}" for zip in ${GAME_ZIPS}; do smbget -au "${SMB_BASE}/${zip}" done unzip -o -d "${GAMES_HOME}" "*.zip"