slack-notifier.sh 302 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

# INFO: This script should be placed in auuser 's homefolder!

# sanity check
if [ "$#" == "0" ]; then
	echo "The message should be passed as an argument!"
	exit 1
fi

data='{"text":"'"$@"'"}'
url=$(head -n 1 slack-url)
curl -X POST -H 'Content-type: application/json' --data "$data" $url