mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 10:12:53 +01:00
connect
This commit is contained in:
@@ -72,27 +72,27 @@ while [[ $# -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
case "$param" in
|
case "$param" in
|
||||||
--id)
|
--id)
|
||||||
id=$1
|
id=$(echo $1 | sed 's/"/\\"/g')
|
||||||
[[ ${#id} -gt 55 ]] && fail "id cannot be longer than 55 characters"
|
[[ ${#id} -gt 55 ]] && fail "id cannot be longer than 55 characters"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--permission)
|
--permission)
|
||||||
perm=$1
|
perm=$(echo $1 | sed 's/"/\\"/g')
|
||||||
[[ ${#perm} -gt 50 ]] && fail "permission cannot be longer than 50 characters"
|
[[ ${#perm} -gt 50 ]] && fail "permission cannot be longer than 50 characters"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--name)
|
--name)
|
||||||
name=$1
|
name=$(echo $1 | sed 's/"/\\"/g')
|
||||||
[[ ${#name} -gt 50 ]] && fail "name cannot be longer than 50 characters"
|
[[ ${#name} -gt 50 ]] && fail "name cannot be longer than 50 characters"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--note)
|
--note)
|
||||||
note=$1
|
note=$(echo $1 | sed 's/"/\\"/g')
|
||||||
[[ ${#note} -gt 100 ]] && fail "note cannot be longer than 100 characters"
|
[[ ${#note} -gt 100 ]] && fail "note cannot be longer than 100 characters"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--searchusername)
|
--searchusername)
|
||||||
searchUsername=$1
|
searchUsername=$(echo $1 | sed 's/"/\\"/g')
|
||||||
[[ ${#searchUsername} -gt 50 ]] && fail "search username cannot be longer than 50 characters"
|
[[ ${#searchUsername} -gt 50 ]] && fail "search username cannot be longer than 50 characters"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@@ -230,8 +230,7 @@ function convertNameToId() {
|
|||||||
|
|
||||||
function createClient() {
|
function createClient() {
|
||||||
name=$1
|
name=$1
|
||||||
perm=$2
|
note=$2
|
||||||
note=$3
|
|
||||||
|
|
||||||
id=$(convertNameToId "$name")
|
id=$(convertNameToId "$name")
|
||||||
now=$(date -u +%FT%TZ)
|
now=$(date -u +%FT%TZ)
|
||||||
@@ -336,7 +335,7 @@ case "${operation}" in
|
|||||||
[[ "$name" == "" ]] && fail "A short client name must be provided"
|
[[ "$name" == "" ]] && fail "A short client name must be provided"
|
||||||
|
|
||||||
lock
|
lock
|
||||||
createClient "$name" "${note}"
|
createClient "$name" "$note"
|
||||||
if [[ "$json" == "1" ]]; then
|
if [[ "$json" == "1" ]]; then
|
||||||
echo "{\"id\":\"$id\",\"secret\":\"$secret\"}"
|
echo "{\"id\":\"$id\",\"secret\":\"$secret\"}"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -100,23 +100,23 @@ while [[ $# -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
case "$param" in
|
case "$param" in
|
||||||
--email)
|
--email)
|
||||||
email=$1
|
email=$(echo $1 | sed 's/"/\\"/g')
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--role)
|
--role)
|
||||||
role=$1
|
role=$(echo $1 | sed 's/"/\\"/g')
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--firstName)
|
--firstName)
|
||||||
firstName=$1
|
firstName=$(echo $1 | sed 's/"/\\"/g')
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--lastName)
|
--lastName)
|
||||||
lastName=$1
|
lastName=$(echo $1 | sed 's/"/\\"/g')
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--note)
|
--note)
|
||||||
note=$1
|
note=$(echo $1 | sed 's/"/\\"/g')
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--skip-sync)
|
--skip-sync)
|
||||||
|
|||||||
Reference in New Issue
Block a user