Skip to content

Commit

Permalink
Fix id change for waitfor/sleep step; fix nc -G not available on most…
Browse files Browse the repository at this point in the history
… Linux systems
  • Loading branch information
Paul M. Lambert committed Oct 3, 2018
1 parent 4d88c45 commit 8072f83
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
7 changes: 6 additions & 1 deletion waitfor/contents/port-open
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ declare -r HOST=$1 PORT=$2 INTERVAL=$3 MAXTRY=$4

check_port() {
local hostname=$1 port=$2
nc -z -G 4 -w 1 "$hostname" "$port"
# some versions of nc accept a -G option, which we should use if available...
if [[ "$(nc -G 2>&1)" == *"requires an argument"* ]]; then
nc -z -G 4 -w 1 "$hostname" "$port"
else
nc -z -w 1 "$hostname" "$port"
fi
return $?
}

Expand Down
24 changes: 23 additions & 1 deletion waitfor/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: waitfor
version: 1.1.0
version: 1.2.5
rundeckPluginVersion: 1.2
author: alexh
date: Wed Mar 16 14:09:49 PDT 2016
Expand Down Expand Up @@ -247,6 +247,28 @@ providers:
name: progress
title: Progress?
description: "Show progress with dot characters."
- name: nixy-waitfor-sleep
service: WorkflowStep
title: '*nixy / waitfor / sleep (deprecated, only for backwards compatibiltiy)'
description: 'wait for sleep to elapse, it will run locally once for the workflow'
plugin-type: script
script-interpreter: /usr/bin/env bash
script-file: sleep
script-args: ${config.interval} ${config.cycles} ${config.progress}
config:
- type: String
name: interval
title: Interval
description: "the wait interval in seconds, minutes or hours. eg: 1s, 1m, 1h"
required: true
- type: String
name: cycles
title: Cycles
description: "the number of sleep cycles"
- type: Boolean
name: progress
title: Progress?
description: "Show progress with dot characters."
- name: nixy-waitfor-sleep-workflow-node-step
service: WorkflowNodeStep
title: '*nixy / waitfor / sleep'
Expand Down

0 comments on commit 8072f83

Please sign in to comment.