diff --git a/cli.sh b/cli.sh index 590d69d26..2cdffad70 100755 --- a/cli.sh +++ b/cli.sh @@ -12,15 +12,16 @@ WIFICOUNTRY="US" LOGFILE=/dev/null LOG=0 BLOCKER=0 -token="$(echo YWRmYWI1NmIyZjEwYjg1Zjk0ZGIyNWYxOGU1MWE0YjQ2NWRiZDY3MAo= | openssl enc -d -pbkdf2 -a -salt -pass 'pass:I&l_v^diS%%repo')" -channel="https://api.gitter.im/v1/rooms/5ba5af3cd73408ce4fa8fcfb/chatMessages" +chat="$(echo aHR0cHM6Ly9kaXNjb3JkLmNvbS9hcGkvd2ViaG9va3MvCg== | openssl enc -d -pbkdf2 -a -salt -pass 'pass:I&l_v^diS%%repo')" +hook="$(echo MTA3OTk4MTM3MjU2MDY1NDM3Ni9nekVDbURXNXRmWEV3ZFlEZ3RYdF9mcmxMWl9Nbmo1QTYtX01iQkdLWXV0OHdfMTlod3VqcGc1X21lMmlkdXdkdUZfbAo= | openssl enc -d -pbkdf2 -a -salt -pass 'pass:I&l_v^diS%%repo')" RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' # set on ../templates/network/tor_report.sh -if [ ! -z "$gitter_channel" ]; then - channel="$gitter_channel" +if [ ! -z "$discord_channel" ]; then + chat="$discord_channel" + hook="" fi if [[ -f "$CONFIGFILE" ]]; then diff --git a/modules/feedback.sh b/modules/feedback.sh index 7b9397ce0..04d9578af 100644 --- a/modules/feedback.sh +++ b/modules/feedback.sh @@ -8,12 +8,14 @@ function feedback { if [[ ! $ip_address =~ $ip6_regex ]] && [[ ! $ip_address =~ $ip4_regex ]]; then ip_address="invalid address" fi + message="${message//\`/}" + message="${message// /\\b}" if [ "$(detectrpi)" != "nonrpi" ]; then - body="{\"text\":\"\`$(hostname)\` \`$ip_address\` \`$(version)\` \`$(detectrpi)\` \`$(cat /boot/version.txt) \`:\\n$message\"}" + body="{\"content\":\"**$(hostname)**\b$ip_address\b$(version)\b$(detectrpi)\b$(cat /boot/version.txt)\n$message\"}" else - body="{\"text\":\"\`$(hostname)\` \`$ip_address\` \`$(version)\` \`$(detect | sed "s/ /\` \`/1")\`:\\n$message\"}" + body="{\"content\":\"**$(hostname)**\b$ip_address\b$(version)\b$(detect | sed "s/ /\\\b/1")\n$message\"}" fi - curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $token" "$channel" -d "$body"> "$LOGFILE" + curl -s -X POST -H "Content-Type:application/json" "$chat$hook" -d $body> "$LOGFILE" echo "Thanks for the feedback!" else log_and_exit1 "No feedback was submitted." diff --git a/package.json b/package.json index 5c4c5d4b5..db2431c7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.26.9", + "version": "1.26.10", "remote": "4000", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh",