Last active
May 22, 2019 19:02
-
-
Save yyoshiki41/2169ea335e88b640e16a87dadc281b0e to your computer and use it in GitHub Desktop.
Copied from https://mackerel.io/file/script/setup-apt-v2.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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