Skip to content

Instantly share code, notes, and snippets.

@yyoshiki41
Last active May 22, 2019 19:02
Show Gist options
  • Save yyoshiki41/2169ea335e88b640e16a87dadc281b0e to your computer and use it in GitHub Desktop.
Save yyoshiki41/2169ea335e88b640e16a87dadc281b0e to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
sudo -k
echo "This script requires superuser authority to setup Mackerel agent:"
sudo sh <<'SCRIPT'
set -x
if command -v curl; then
http_get="curl -LfsS"
elif command -v wget; then
http_get="wget -q -O -"
fi
if [ "$http_get" = "" ]; then
echo "curl or wget are required to install the mackerel-agent"
exit 1
fi
echo "deb [arch=amd64] http://apt.mackerel.io/v2/ mackerel contrib" > /etc/apt/sources.list.d/mackerel.list
$http_get https://mackerel.io/file/cert/GPG-KEY-mackerel-v2 | apt-key add -
apt-get update -qq
SCRIPT
echo 'done'
echo 'To install mackerel-agent type: sudo apt-get install mackerel-agent'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment