forked from tirtadji-com/rpi_debian_ha_supervised
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
47 lines (42 loc) · 1.28 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
###############################################################
# Created by Richard Tirtadji
# Auto installer for Raspberry on Debian 10 + HA Supervised
# Installer scripts
###############################################################
apt-get update && apt-get dist-upgrade -y && apt autoremove -y
apt-get -y install unzip lsb-release wget locales locales-all
apt-get -y install avahi-daemon avahi-discover libnss-mdns
# Check Procedure
LINUX='lsb_release -is'
if [ $(id -u) -ne 0 ]; then
echo "Run this script as a Root user only" >&2
exit 1
fi
if [[ $LINUX -ne Debian ]]; then
echo "This script usage only for Debian" >&2
exit 1
fi
cd ~
wget https://github.com/tirtadji-com/rpi_debian_ha_supervised/archive/main.zip
unzip /root/main.zip -d /root/
result=`ls -F /root/ | grep /`
mv /root/$result/* /root/
rm -r /root/$result
chmod +x /root/*.sh
chmod +x /root/install/*.sh
chmod +x /root/hass/*.sh
chmod +x /root/docker/*.sh
rm /root/main.zip
/root/main.sh
rm /root/main.sh
rm -rf /root/motd
/root/home-assistant.sh
rm /root/home-assistant.sh
rm /root/install/docker-install.sh
rm /root/install/fail2ban-install.sh
rm /root/install/ufw-install.sh
rm /root/hass/glances-install.sh
rm /root/hass/samba-install.sh
rm /root/docker/hass-install.sh
echo -e "HA installation complete"