update push

This commit is contained in:
Felix Van der Jeugt 2016-01-10 19:55:38 +01:00
parent 0af92996a5
commit 86ae6cd76b
1 changed files with 6 additions and 5 deletions

View File

@ -4,23 +4,24 @@
set -e set -e
sshhost="Flesje" sshhost="Flesje"
fles="http://flashyoshi.me" fles="http://t2-wan.be"
port="7070"
# Find ssh username # Find ssh username
user=$( user=$(
# Join config entries # Join config entries
sed -n '$!{/host /I!{H;d}};x;s/\n/ /g;p' $HOME/.ssh/config | sed -n '$!{/host /I!{H;d}};x;s/\n/ /g;p' $HOME/.ssh/config |
# Extract user/host combinations # Extract user/host combinations
grep -i 'user' | grep -i 'user' | tr -s ' ' ' ' |
sed 's/^.*host \([^ \t]\+\).*user \([^ \t]\+\).*$/\1 \2/I' | sed 's/^.*host \([^ \t]\+\).*user \([^ \t]\+\).*$/\1 \2/I' |
# Find user # Find user
(grep "^$sshhost" || echo $USER) | cut -d ' ' -f 2 ) (grep "^$sshhost" || echo $USER) | cut -d ' ' -f 2 )
file="$(mktemp XXXXXX.png)" file="$(mktemp XXXXXX.png)"
escrotum $* "$file" escrotum $* "$file"
chmod 755 $file chmod 644 $file
scp -p $file $sshhost:~/images/ scp -p $file $sshhost:~/images/
rm "$file" rm "$file"
url="$fles:8080/~$user/images/$file" url="$fles:$port/~$user/$file"
notify-send "Screenshot uploaded to $url" notify-send "Screenshot uploaded to $url"
echo "$url" | xclip echo "$url" | xclip