Skip to content

Instantly share code, notes, and snippets.

@faiwer

faiwer/bash.sh Secret

Created October 2, 2015 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faiwer/9847245ed2f4c869b956 to your computer and use it in GitHub Desktop.
Save faiwer/9847245ed2f4c869b956 to your computer and use it in GitHub Desktop.
xclip -selection clipboard -out > /tmp/ftp_clipboard
A=$(cat /tmp/ftp_clipboard);
A=$(echo $A | sed 's/\/home\/faiwer/http:\/\/ftp\.faiwer\.ru/g')
CODE=$(curl --write-out "%{http_code}\n" --silent --output /dev/null "$A")
echo $A
if [ $CODE != "200" ];
then
notify-send -u critical "Error" "Не удалось проверить файл $A"
else
notify-send -u normal "FTP" "$CODE :: $A"
fi
echo $A | xclip -selection clipboard -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment