1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash
script_dir="$(realpath $(dirname ${0}))"
if git diff-index --quiet HEAD --; then
if git describe --exact-match --tags HEAD -- 2>/dev/null; then
cat > ~/.ssh/known_hosts <<EOF
$(cat ~/.fidi_known_hosts)
EOF
ssh -F ~/.fidi_demo_ssh_config demo ./update.sh $(git rev-parse --verify HEAD)
else
echo This is not a tag! Exiting...
exit 0
fi
else
echo Local changes detected! Exiting...
exit 0
fi