Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- pgm="${0##*/}" # Program basename
- [ $# -gt 0 ] || { echo "Usage: $pgm [ssh_options] ssh_host" >&2; exit 1; }
- GOURCE_OPTIONS="
- --1280x800 --auto-skip-seconds 1 --bloom-intensity 0.25
- --file-idle-time 2 --highlight-users --log-format custom
- --output-ppm-stream - --seconds-per-day 0.01
- " # END-QUOTE
- FFMPEG_OPTIONS="
- -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264
- -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0
- " # END-QUOTE
- ssh "$@" sh - <<'EOF' | awk '{
- (cmd = sprintf("date -jf \"%s\" \"%s\" +%%s", "%Y %b %e %T",
- datetime = substr($0, 1, 20))) | getline epoch
- close(cmd)
- printf "%s|%s|M|/%s/%s\n", epoch,
- remoteip = $9, iface = $6, localip = $7
- }' | gource $GOURCE_OPTIONS - | ffmpeg $FFMPEG_OPTIONS "${pgm%.*}.mp4"
- ################################################## REMOTE SCRIPT
- remote=$( sockstat | awk -v pid=$PPID '$3==pid && $5~/^tcp/{print $NF; exit}' )
- addr="${remote%:*}"
- case "$addr" in
- *:*) addr="[$addr]" ;;
- esac
- dwatch -X ip -t "this->remote != \"$addr\""
- EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement