#!/bin/bash help(){ echo """ "${0}" [options] -d2 Move Diablo II save game files """ } mv_d2(){ remoteDir=${HOME}/diablo/drive_c/users/mollusk/"Saved Games"/"Diablo II" echo "${remoteDir}" if [[ ! -d ./"Diablo II" ]];then echo "Local save directory does not exist" exit 1 fi if [[ ! -d "${remoteDir}" ]];then echo "Remote directory does not exist" exit 1 fi case "${1}" in --from-remote) echo "Moving files from ${remoteDir} to $(pwd)/Diablo II" cp "${remoteDir}"/* "$(pwd)"/"Diablo II" ;; --to-remote) echo "Moving files to ${remoteDir} from $(pwd)/Diablo II" cp "$(pwd)"/"Diablo II"/* "${remoteDir}" ;; *) echo "--from-remote Move files from real game folder to repo" echo "--to-remote Move files to real game folder from repo" ;; esac } case "${1}" in -d2) mv_d2 "${2}" ;; *) help ;; esac