mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-10-31 11:22:28 +00:00 
			
		
		
		
	Add ability to execute functions as a command
This gives easier access over nodeshell and similar to run functions by executing the functions as a script with arguments.
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function set_confluent_vars() { | ||||
|     if [ -z "$nodename" ]; then | ||||
|         nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}') | ||||
| @@ -134,3 +135,5 @@ run_remote_config() { | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -169,4 +170,5 @@ run_remote_config() { | ||||
|     echo '---------------------------------------------------------------------------' | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -161,4 +162,5 @@ run_remote_config() { | ||||
|     echo '---------------------------------------------------------------------------' | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -111,3 +112,6 @@ run_remote_config() { | ||||
|     echo '---------------------------------------------------------------------------' | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -170,3 +171,5 @@ run_remote_config() { | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -119,3 +120,5 @@ run_remote_config() { | ||||
|     echo '---------------------------------------------------------------------------' | ||||
|     return | ||||
| } | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| #!/bin/bash | ||||
| function test_mgr() { | ||||
|     if curl -s https://${1}/confluent-api/ > /dev/null; then | ||||
|         return 0 | ||||
| @@ -122,3 +123,5 @@ run_remote_config() { | ||||
|     return | ||||
| } | ||||
|  | ||||
| #If invoked as a command, use the arguments to actually run a function | ||||
| (return 0 2>/dev/null) || $1 "${@:2}" | ||||
		Reference in New Issue
	
	Block a user