Skip to content

Instantly share code, notes, and snippets.

@mykolq
Last active June 7, 2019 14:01
Show Gist options
  • Select an option

  • Save mykolq/b0cd188cd5fc6f3296c55e98bc9ba121 to your computer and use it in GitHub Desktop.

Select an option

Save mykolq/b0cd188cd5fc6f3296c55e98bc9ba121 to your computer and use it in GitHub Desktop.
set smtp settings for supermicro ipmi with curl
#!/bin/bash
USER=$1
PASS=$2
IPMI_HOST=$3
SMTP_SERVER=$4
SMTP_PORT=$5
SMTP_USER=$7
SMTP_PASS=$8
SMTP_SENDER=$6
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }')
curl -X POST -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/cgi/config_smtp.cgi" -d "smtpaddr=${SMTP_SERVER}&smtpport=${SMTP_PORT}&user=${SMTP_USER}&pwd=${SMTP_PASS}&sender=${SMTP_SENDER}&auth_en=off&_="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment