Updated the fish script to the new dcav location, and will now display error messages if scp fails.

This commit is contained in:
Jon Michael Aanes 2017-11-01 15:06:31 +01:00
parent 84371c963a
commit 4f1a82e60b

View File

@ -5,7 +5,8 @@ set SCP_USER "jmaa"
set SRT_USER "j" set SRT_USER "j"
# Other stuff # 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 SCP_PATH "~/public_html/screenshots"
set HTTP_URL "http://dcav.pw/$SRT_USER" set HTTP_URL "http://dcav.pw/$SRT_USER"
@ -36,6 +37,10 @@ if test $TEMP_FILE
echo $HTTP_URL$LINK | xclip -i -sel clip echo $HTTP_URL$LINK | xclip -i -sel clip
display_message "Screenshot taken. File accessable at '$HTTP_URL$LINK'" display_message "Screenshot taken. File accessable at '$HTTP_URL$LINK'"
# #
scp $TEMP_FILE "$SCP_USER@$SCP_HOST:$SCP_PATH/$FILENAME" set -l msg (scp -o ConnectTimeout=1 -P $SCP_PORT $TEMP_FILE "$SCP_USER@$SCP_HOST:$SCP_PATH/$FILENAME" 2>&1)
rm $TEMP_FILE 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 end