[fix] so-user spelling+syntax fixes

* Consistent ending punctuation
* Consistent capitalization
* Correct comparison operators
This commit is contained in:
William Wernert
2020-10-15 13:44:23 -04:00
parent 35b10b1f91
commit 1fdf431c12
5 changed files with 13 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ fi
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
if [[ $? -ne 0 ]]; then
echo "Failed to generate Fleet password hash."
echo "Failed to generate Fleet password hash"
exit 2
fi
@@ -56,9 +56,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
"INSERT INTO users (password,salt,username,email,admin,enabled) VALUES ('$FLEET_HASH','','$FLEET_USER','$FLEET_USER',1,1)" 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully added user to Fleet."
echo "Successfully added user to Fleet"
else
echo "Unable to add user to Fleet; user might already exist."
echo "Unable to add user to Fleet; user might already exist"
echo $resp
exit 2
fi

View File

@@ -20,7 +20,7 @@
usage() {
echo "Usage: $0 <user-name>"
echo ""
echo "Enables or disables a user in Fleet."
echo "Enables or disables a user in Fleet"
exit 1
}
@@ -50,9 +50,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
"UPDATE users SET enabled=$FLEET_STATUS WHERE username='$FLEET_USER'" 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully updated user in Fleet."
echo "Successfully updated user in Fleet"
else
echo "Failed to update user in Fleet."
echo "Failed to update user in Fleet"
echo $resp
exit 2
fi

View File

@@ -49,9 +49,9 @@ fi
# Create new user in TheHive
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
echo "Successfully added user to TheHive."
echo "Successfully added user to TheHive"
else
echo "Unable to add user to TheHive; user might already exist."
echo "Unable to add user to TheHive; user might already exist"
echo $resp
exit 2
fi

View File

@@ -20,7 +20,7 @@
usage() {
echo "Usage: $0 <user-name> <true|false>"
echo ""
echo "Enables or disables a user in thehive."
echo "Enables or disables a user in TheHive."
exit 1
}
@@ -48,9 +48,9 @@ esac
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user/${THEHIVE_USER}" -d "{\"status\":\"${THEHIVE_STATUS}\" }")
if [[ "$resp" =~ \"status\":\"Locked\" || "$resp" =~ \"status\":\"Ok\" ]]; then
echo "Successfully updated user in thehive."
echo "Successfully updated user in TheHive"
else
echo "Failed to update user in thehive."
echo "Failed to update user in TheHive"
echo "$resp"
exit 2
fi

View File

@@ -10,7 +10,7 @@
. /usr/sbin/so-common
if [[ $# < 1 || $# > 2 ]]; then
if [[ $# -lt 1 || $# -gt 2 ]]; then
echo "Usage: $0 <list|add|update|enable|disable|validate|valemail|valpass> [email]"
echo ""
echo " list: Lists all user email addresses currently defined in the identity system"
@@ -22,7 +22,7 @@ if [[ $# < 1 || $# > 2 ]]; then
echo " valemail: Validates that the given email address is acceptable for defining a new user; requires 'email' parameter"
echo " valpass: Validates that a password is acceptable for defining a new user"
echo ""
echo " Note that the password can be piped into stdin to avoid prompting for it."
echo " Note that the password can be piped into STDIN to avoid prompting for it"
exit 1
fi