Created
May 30, 2024 16:01
-
-
Save nimdasx/1b5847aa1fffa0992db8eb53618dbf07 to your computer and use it in GitHub Desktop.
notif-discord.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#masukkan ini ke dalam file .ssh/rc | |
~/notif-discord.sh "user $(whoami) login ke server $(hostname) pada ${date}" | |
#buat file notif-discord.sh dengan isi | |
discord_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
discord_channel=11111111111111111111 | |
discord_pesan=$1 | |
curl \ | |
-i \ | |
-H "Accept: application/json" \ | |
-H "Content-Type:application/json" \ | |
-X POST \ | |
--data "{\"content\": \"$discord_pesan\"}" https://discord.com/api/webhooks/$discord_channel/$discord_token \ | |
> /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment