diff options
Diffstat (limited to 'templates/restart/ssh/node.def')
-rw-r--r-- | templates/restart/ssh/node.def | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/templates/restart/ssh/node.def b/templates/restart/ssh/node.def index c8f59a9..1fa1aff 100644 --- a/templates/restart/ssh/node.def +++ b/templates/restart/ssh/node.def @@ -1,9 +1,12 @@ help: Restart SSH service run: - echo "Restarting SSH..." - sudo /usr/sbin/invoke-rc.d ssh restart - if [[ $? -eq 0 ]]; then - echo "Success!" - fi - + if cli-shell-api existsActive service ssh; then + echo "Restarting SSH..." + sudo /usr/sbin/invoke-rc.d ssh restart + if [[ $? -eq 0 ]]; then + echo "Success!" + fi + else + echo "SSH is not configured" + fi |