Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various install.sh fixes #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,30 @@ mkdir -p data/grafana
sudo chown 472 data/grafana

# Install docker/docker-compose if not exists
if ! hash docker 2>/dev/null; then
if ! which docker >/dev/null; then
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
fi
if ! hash docker-compose 2>/dev/null; then
apt-get install docker-compose
if ! which docker-compose >/dev/null; then
sudo apt-get install docker-compose
fi

# Check if we have docker permissions
if [ "$EUID" -ne 0 ] && ! (groups | grep &>/dev/null '\bdocker\b'); then
echo "Run this script as a user with docker rights"
echo "Or add this user to the docker group:"
echo
echo " sudo usermod -aG docker $(id -u -n)"
echo
echo "Then re-login"
exit
fi

# Start Docker Stack
./dashboard2docker.sh
docker-compose up -d

# Make the scraper start start on boot
cp tesla-apiscraper.service /lib/systemd/system
sudo cp tesla-apiscraper.service /lib/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable tesla-apiscraper.service

# Add pi or any other user you would like to the Docker Group
usermod -aG docker $(id -u -n)
reboot