new scripts
This commit is contained in:
parent
93f2c0c3bd
commit
e60faffbde
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
EMAIL=$1
|
||||
OOO_ACTIVE=$2 # true/false
|
||||
OOO_MESSAGE="$3"
|
||||
OOO_CONTENT_TYPE=${4:-text} # Optional: text oder html, default text
|
||||
FORWARDS="$5" # Komma-separiert, z.B. "ebrunks@bayarea-cc.com,andreas.knuth@bayarea-cc.com"
|
||||
|
||||
if [ -z "$EMAIL" ] || [ -z "$OOO_ACTIVE" ]; then
|
||||
echo "Usage: $0 email@domain.com true/false 'OOO Message' [ooo_content_type] 'forward1,forward2'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FORWARDS_LIST=$(echo "$FORWARDS" | jq -R 'split(",") | map({"S": .})') # Konvertiere zu JSON-Array von {"S": "value"}
|
||||
|
||||
aws dynamodb put-item \
|
||||
--table-name email-rules \
|
||||
--item '{
|
||||
"email_address": {"S": "'"$EMAIL"'"},
|
||||
"ooo_active": {"BOOL": '"$OOO_ACTIVE"'},
|
||||
"ooo_message": {"S": "'"$OOO_MESSAGE"'"},
|
||||
"ooo_content_type": {"S": "'"$OOO_CONTENT_TYPE"'"},
|
||||
"forwards": {"L": '"$FORWARDS_LIST"'},
|
||||
"last_updated": {"S": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"}
|
||||
}' \
|
||||
--region us-east-2
|
||||
Loading…
Reference in New Issue