examples: add option --interactive|-i

This commit is contained in:
Erik Arvstedt
2020-10-18 13:41:55 +02:00
parent 33ff8d82be
commit c19f7ebb01
5 changed files with 33 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ set -euo pipefail
if [[ ! -v IN_NIX_SHELL ]]; then
echo "Running script in nix shell env..."
cd "${BASH_SOURCE[0]%/*}"
exec nix-shell --run "./${BASH_SOURCE[0]##*/}"
exec nix-shell --run "./${BASH_SOURCE[0]##*/} $*"
fi
# Cleanup on exit
@@ -40,7 +40,11 @@ nixops deploy -d bitcoin-node
nixops ssh bitcoin-node systemctl status bitcoind
c() { nixops ssh bitcoin-node "$@"; }
# Uncomment to start a shell session here
# . start-bash-session.sh
case ${1:-} in
-i|--interactive)
. start-bash-session.sh
;;
esac
# Cleanup happens at exit (see above)