1
0

Allow specify port in deploy script

This commit is contained in:
clerie 2020-12-26 01:51:26 +01:00
parent a4e1bb74cf
commit 2666206b45

View File

@ -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}