Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- explorer "https://google.com"
- putty -ssh pi@192.168.0.12 22 -pw Kar2ffel!
- #!/bin/sh
- ip="$(hostname -I | awk '{print $1}')"
- locale=da_DK.UTF-8
- tz=Europe/Copenhagen
- read -p "Indtast dit hostname på systemet: " hostname
- read -p "Indtast dit nye kodeord: " password
- read -p "Indtast dit DuckDNS domæne: " domain
- read -p "Indtast dit Token: " token
- read -p "Indtast din email adresse: " email
- # Opdatering
- sudo apt update -y
- sudo apt full-upgrade -y
- sudo apt autoremove -y
- sudo apt clean -y
- sudo apt autoclean -y
- # Konfiguration
- sudo raspi-config nonint do_hostname %hostname
- sudo raspi-config nonint do_boot_behaviour B2
- sudo raspi-config nonint do_boot_wait 0
- sudo raspi-config nonint do_change_locale $locale
- sudo raspi-config nonint do_change_timezone $tz
- sudo raspi-config # ÆNDRES
- # Ekstra pakker
- sudo apt-get install mc python-pip augeas-lenses libaugeas0 libffi-dev libssl-dev python-virtualenv python3-virtualenv virtualenv -y
- # Docker, Docker-Compose + mapper
- cd
- curl -fsSL get.docker.com -o get-docker.sh
- sudo sh get-docker.sh
- sudo usermod -aG docker pi
- sudo pip install docker-compose~=1.23.2
- sudo mkdir /opt
- sudo chown pi:pi /opt
- cd /opt
- mkdir homeassistant organizr portainer duckdns
- # Reboot
- sudo reboot # måske ikke nødvendigt
- # Docker-Compose
- wget -O /opt/docker-compose.yaml http://my.ocloud.dk/index.php/s/67CwXciqmYzWZMD/download
- cd /opt # Hvis reboot ikke var nødvendig - så slettes
- docker-compose pull
- # Home Assistant
- docker-compose up -d homeassistant
- # Portainer
- docker-compose up -d portainer
- # DuckDNS
- echo 'echo url="https://www.duckdns.org/update?domains='$domain'&token='$token'&ip=" | curl -k -o /opt/duckdns/duck.log -K -' > ./duckdns/duck1.sh
- chmod 700 ./duckdns/duck.sh
- crontab -l > file; echo "*/5 * * * * /opt/duckdns/duck.sh >/dev/null 2>&1" >> file; crontab file; rm file
- # Cert-Bot
- cd /
- sudo wget https://dl.eff.org/certbot-auto
- sudo chmod 755 certbot-auto
- sudo rm /etc/pip.conf -f
- ./certbot-auto certonly --standalone --preferred-challenges http-01 --email $email -d $domain.duckdns.org
- ./certbot-auto certonly --standalone --preferred-challenges http-01 --email $email -d ha.$domain.duckdns.org
- ./certbot-auto certonly --standalone --preferred-challenges http-01 --email $email -d portainer.$domain.duckdns.org
- # Organizr
- cd /opt
- docker-compose up -d organizr
- sed -i 's/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 64;/g' /opt/organizr/nginx/nginx.conf
- rm organizr/nginx/site-confs/default
- wget -O organizr/nginx/site-confs/default https://my.ocloud.dk/index.php/s/JtrTDtmwkgf8eLA/download
- wget -O organizr/nginx/site-confs/homeassistant https://my.ocloud.dk/index.php/s/9MbJYc5Sd7EbLnf/download
- wget -O organizr/nginx/site-confs/portainer https://my.ocloud.dk/index.php/s/pbARKoQg8BRRFit/download
- wget -O organizr/nginx/site-confs/upstreams http://my.ocloud.dk/index.php/s/LSNZA8QWAHpnjSW/download
- sed -i "s/DIT_DOMAIN/$domain;/g" organizr/nginx/site-confs/default
- sed -i "s/DIT_DOMAIN/$domain;/g" organizr/nginx/site-confs/homeassistant
- sed -i "s/DIT_DOMAIN/$domain;/g" organizr/nginx/site-confs/portainer
- sed -i "s/DIN_PI_IP/$ip/g" organizr/nginx/site-confs/upstreams
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement