diff --git a/screenshot.fish b/screenshot.fish index d481e30..311409a 100755 --- a/screenshot.fish +++ b/screenshot.fish @@ -5,7 +5,8 @@ set SCP_USER "jmaa" set SRT_USER "j" # Other stuff -set SCP_HOST "strawberry.thedevcave.net" +set SCP_PORT "35284" +set SCP_HOST "users.guava.space" set SCP_PATH "~/public_html/screenshots" set HTTP_URL "http://dcav.pw/$SRT_USER" @@ -36,6 +37,10 @@ if test $TEMP_FILE echo $HTTP_URL$LINK | xclip -i -sel clip display_message "Screenshot taken. File accessable at '$HTTP_URL$LINK'" # - scp $TEMP_FILE "$SCP_USER@$SCP_HOST:$SCP_PATH/$FILENAME" - rm $TEMP_FILE + set -l msg (scp -o ConnectTimeout=1 -P $SCP_PORT $TEMP_FILE "$SCP_USER@$SCP_HOST:$SCP_PATH/$FILENAME" 2>&1) + if test $status -eq 0 + rm $TEMP_FILE + else + display_message "Error occured when attempting to upload screenshot to dcav. File saved into '$TEMP_FILE'. Please see error-message: $msg" + end end