From 2666206b450f5ccd7602bc62381cf39ca6d03544 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 26 Dec 2020 01:51:26 +0100 Subject: [PATCH] Allow specify port in deploy script --- deploy.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 8ae9f8d..e42623a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,6 +2,7 @@ DEPLOY_HOST=$1 DEPLOY_ADDRESS=$2 +DEPLOY_PORT=$3 if [ -z $DEPLOY_HOST ]; then exit 1 @@ -12,7 +13,7 @@ nixos-rebuild switch \ -I nixos-config=hosts/${DEPLOY_HOST}/configuration.nix \ " -if [ -z $DEPLOY_ADDRESS ]; then +if [ -z $DEPLOY_ADDRESS ] || [ $DEPLOY_ADDRESS = "-" ]; then DEPLOY_ADDRESS="clerie@${DEPLOY_HOST}.net.clerie.de" fi @@ -24,4 +25,8 @@ if [ $DEPLOY_ADDRESS != "localhost" ]; then " fi +if [ -n "$DEPLOY_PORT" ]; then + cmd="NIX_SSHOPTS=\"-p $DEPLOY_PORT\" ${cmd}" +fi + eval ${cmd}