diff options
Diffstat (limited to 'commands')
-rwxr-xr-x | commands/ifconfig/interfaces-names | 3 | ||||
-rwxr-xr-x | commands/jails/list | 6 | ||||
-rwxr-xr-x | commands/tests/test_ensure_command_exists.sh | 3 | ||||
-rwxr-xr-x | commands/tests/test_exit.sh | 3 |
4 files changed, 15 insertions, 0 deletions
diff --git a/commands/ifconfig/interfaces-names b/commands/ifconfig/interfaces-names new file mode 100755 index 0000000..f058404 --- /dev/null +++ b/commands/ifconfig/interfaces-names @@ -0,0 +1,3 @@ +#!./cloyster + +return_result $(ifconfig | grep -E "^[a-z0-9_]+:" | cut -d ':' -f 1 | jq -nRr '[inputs | select(length>0)] | @json') diff --git a/commands/jails/list b/commands/jails/list new file mode 100755 index 0000000..b7e009e --- /dev/null +++ b/commands/jails/list @@ -0,0 +1,6 @@ +#!./cloyster + +ensure_command_exists jls + +list=$(jls --libxo json | jq -r '.["jail-information"].jail | @json') +return_result "${list}" diff --git a/commands/tests/test_ensure_command_exists.sh b/commands/tests/test_ensure_command_exists.sh new file mode 100755 index 0000000..646d2c1 --- /dev/null +++ b/commands/tests/test_ensure_command_exists.sh @@ -0,0 +1,3 @@ +#!./cloyster + +ensure_command_exists notgoingtoexist diff --git a/commands/tests/test_exit.sh b/commands/tests/test_exit.sh new file mode 100755 index 0000000..2ad2699 --- /dev/null +++ b/commands/tests/test_exit.sh @@ -0,0 +1,3 @@ +#!./cloyster + +exit 42 |