-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathannouncement
executable file
·35 lines (34 loc) · 1.11 KB
/
announcement
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Made by kxtzownsu & Fallenmoon8080
# Fixed by Fallenmoon8080
# command line version on vm, not used by bot
HOOK=1
WALL=1
VERSION="1.1.3"
URI="webhookfordiscord"
if [[ "$*" == "" ]] ; then
printf "Usage: $0 <options> <quoted message>\n -h Show this help message\n -v Show the program's version\n -n Don't send a wall, just post to the webhook\n -c Just print the message to console, no wall\n"
else
for (( i=1 ; i<=$# ; i++ )); do
if [[ ${!i} == "--help" || ${!i} == "-h" ]]; then
printf "Usage: $0 <options> <quoted message>\n -h Show this help message\n -v Show the program's version\n -n Don't send a wall, just post to the webhook\n -c Just print the message to console, no wall\n"
elif [[ ${!i} == "-v" ]]; then
printf "Announcement Utility by Fallenmoon8080\n Version $VERSION \n"
elif [[ ${!i} == "-n" ]]; then
WALL=0
elif [[ ${!i} == "-c" ]]; then
WALL=0
HOOK=0
else
if [[ $HOOK == 1 ]]; then
curl -H "Content-Type: application/json" \
-d '{"content": "'"${!i}"'"}' \
$URI
fi
if [[ $WALL == 1 ]]; then
wall ${!i}
fi
printf "${!i}\n"
fi
done
fi