Skip to content

Commit

Permalink
fix: Checking variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyaten committed Sep 5, 2020
1 parent 5096289 commit a5f3fd4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/bin/bash
set -e
ls -la

if ! [ -z $INPUT_BEFORE_SCRIPT ]; then
if ! [ -z "$INPUT_BEFORE_SCRIPT" ]; then
CMD="${INPUT_BEFORE_SCRIPT/$'\n'/' && '}"
sshpass -p $INPUT_PASSWORD ssh -o stricthostkeychecking=no -p $INPUT_PORT $INPUT_USERNAME@$INPUT_HOST "$CMD";
fi

if ! [ -z $INPUT_SCP_SOURCE ]; then
if ! [ -z "$INPUT_SCP_SOURCE" ]; then
sshpass -p $INPUT_PASSWORD scp -o stricthostkeychecking=no -P $INPUT_PORT -r $INPUT_SCP_SOURCE $INPUT_USERNAME@$INPUT_HOST:$INPUT_SCP_TARGET
fi

if ! [ -z $INPUT_AFTER_SCRIPT ]; then
if ! [ -z "$INPUT_AFTER_SCRIPT" ]; then
CMD="${INPUT_AFTER_SCRIPT/$'\n'/' && '}"
sshpass -p $INPUT_PASSWORD ssh -o stricthostkeychecking=no -p $INPUT_PORT $INPUT_USERNAME@$INPUT_HOST "$CMD";
fi

0 comments on commit a5f3fd4

Please sign in to comment.