Skip to content

Instantly share code, notes, and snippets.

@gimmi
Last active January 22, 2023 19:10
Show Gist options
  • Save gimmi/881d7362e0ed196a2e70b84112320a79 to your computer and use it in GitHub Desktop.
Save gimmi/881d7362e0ed196a2e70b84112320a79 to your computer and use it in GitHub Desktop.
bash
# syntax=docker/dockerfile:1
FROM busybox:musl
# IMPORTANT: line ending must be LF, indentation must be tabs
COPY --chmod=777 <<-EOF /wait.sh
#!/bin/sh
trap 'pkill sleep' INT TERM
echo 'Started, press Ctrl+C to stop'
sleep infinity &
wait
echo 'Stopped'
EOF
ENTRYPOINT ["/wait.sh"]
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$0")"
if ! git --no-pager -C bastion-scripts diff-index --quiet HEAD; then
echo "ERROR: Commit before sync"
exit 1
fi
# GIT_COMMENT="$1"
# git --no-pager -C "$SCRIPT_DIR" add -A
# git --no-pager -C "$SCRIPT_DIR" commit -a -m "${GIT_COMMENT}"
# git --no-pager -C "$SCRIPT_DIR" push
rm -f bastion-scripts.tar
git --no-pager -C bastion-scripts ls-files | while read -r git_path; do
tar --append --verbose --file bastion-scripts.tar "bastion-scripts/${git_path}"
done
# ssh -i ~/.ssh/bastion-rke rke@192.168.201.105 mkdir --parents bastion-scripts
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_oiadp bastion-scripts.tar oiadp@192.168.201.105:~
ssh -oStrictHostKeyChecking=no -i ~/.ssh/id_oiadp oiadp@192.168.201.105 tar --extract --overwrite --verbose --file bastion-scripts.tar
#!/bin/sh
trap 'pkill sleep' INT TERM
echo 'Started, press Ctrl+C to stop'
sleep infinity &
wait
echo 'Stopping'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment