From f0da05553809beac4795b76074573e7c3e5bcb8c Mon Sep 17 00:00:00 2001 From: mollusk Date: Sat, 30 Jan 2021 11:38:45 -0700 Subject: [PATCH] Update: manager.sh --- manage.sh | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/manage.sh b/manage.sh index 3386ec1..48812e2 100755 --- a/manage.sh +++ b/manage.sh @@ -1,16 +1,41 @@ #!/bin/bash -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 +help(){ + echo """ -echo "Moving files from ${remoteDir} to $(pwd)/Diablo II" -cp "${remoteDir}"/* "$(pwd)"/"Diablo II" \ No newline at end of file +"${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 + + echo "Moving files from ${remoteDir} to $(pwd)/Diablo II" + cp "${remoteDir}"/* "$(pwd)"/"Diablo II" +} + +case "${1}" in + + -d2) + mv_d2 + ;; + + *) + help + ;; +esac + \ No newline at end of file