Page 1 of 1

bash Notification script help [Solved]

Posted: February 11th, 2020, 5:11 am
by phyzical
Hey there im not sure if this is the right place but im just trying to make a simple slack notifier

Code: Select all

#!/bin/bash

curl -X POST -H 'Content-type: application/json' --data '{"text":"*$1* \n*$(2)* \n${3}"}' https://hooks.slack.com/services/SECRET
This posts to my channel fine, my issue is that 1,2 and 3 dont seem to be passed through to the script as arguments it just posts a literal $1 $(2) ${3}

can anyone see what i messed up.

I also try nzb-notify.py but that seemed to not post at all

thanks!

Re: bash Notification script help

Posted: February 11th, 2020, 5:18 am
by phyzical
DERP as i posted this i realized i can just call the bash script to test it >.>

Code: Select all

#!/bin/bash

curl -X POST -H 'Content-type: application/json' --data '{"text":"*'$1'* \n*'$2'* \n'$3'"}' https://hooks.slack.com/services/SECRET
so what i needed as the $ was lost

thanks rubberduckies