Skip to content

Instantly share code, notes, and snippets.

@nimdasx
Created May 30, 2024 16:01
Show Gist options
  • Save nimdasx/1b5847aa1fffa0992db8eb53618dbf07 to your computer and use it in GitHub Desktop.
Save nimdasx/1b5847aa1fffa0992db8eb53618dbf07 to your computer and use it in GitHub Desktop.
notif-discord.sh
#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