build 662 B

12345678910111213141516171819202122232425
  1. #!/bin/bash -e
  2. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. cd "${SCRIPT_DIR}"
  4. if [ ! -f "./rclone.conf" ];then
  5. echo "Could not find $(pwd)/rclone.conf"
  6. exit 1
  7. fi
  8. mkdir -p ./bin
  9. GOPATH=$(pwd) go build -o ./bin/etcd2-restore etcd2-restore.go
  10. tar cfz ./etcd2-backup.tgz \
  11. *.{service,timer,conf} \
  12. etcd2-join \
  13. bin/etcd2-restore \
  14. rclone.conf \
  15. etcd2-backup-install
  16. printf "Install package saved at\n\t -> $(pwd)/etcd2-backup.tgz\n\n"
  17. printf "Copy to target machine and deploy.\n $> tar zxvf etcd2-backup.tgz && ./etcd2-backup-install\n\n"
  18. echo "WARNING: this tarball contains your rclone secrets. Be careful!"