#!/bin/bash cd /data/music/flac rsync -a --progress * thrakkorzog:/home/luket/flac ssh thrakkorzog 'cd /home/luket/git/library_works && ./encode_all' if [[ "$?" == 0 ]]; then rsync -a --progress thrakkorzog:/home/luket/opus/* /data/music/opus/ else printf 'Something went wrong in SSH\n' >&2 exit 1 fi