Skip to content

Instantly share code, notes, and snippets.

@bskjon
Last active October 7, 2022 15:28
Show Gist options
  • Save bskjon/79774b29ff388a9f92468ea0c28c2f43 to your computer and use it in GitHub Desktop.
Save bskjon/79774b29ff388a9f92468ea0c28c2f43 to your computer and use it in GitHub Desktop.
Homeassistant Supervised Installer
#!/bin/bash
echo "
_ _ ____ __ __ ______ _____ _____ _____ _____ _______ _ _ _______
| | | |/ __ \| \/ | ____| /\ / ____/ ____|_ _|/ ____|__ __|/\ | \ | |__ __|
| |__| | | | | \ / | |__ / \ | (___| (___ | | | (___ | | / \ | \| | | |
| __ | | | | |\/| | __| / /\ \ \___ \\___ \ | | \___ \ | | / /\ \ | | | |
| | | | |__| | | | | |____ / ____ \ ____) |___) |_| |_ ____) | | |/ ____ \| |\ | | |
|_| |_|\____/|_| |_|______/_/ \_\_____/_____/|_____|_____/ |_/_/ \_\_| \_| |_|
_____ ______ _______ _ _ _____
/ ____| ____|__ __| | | | __ \
| (___ | |__ | | | | | | |__) |
\___ \| __| | | | | | | ___/
____) | |____ | | | |__| | |
|_____/|______| |_| \____/|_|
"
apt install -y \
jq \
wget \
curl \
udisks2 \
libglib2.0-bin \
network-manager \
dbus -y
wget -O docker-install.sh "https://gist.githubusercontent.com/bskjon/becb3de2cb3a5ad175bec0cc0fcee4bd/raw/d85ace6f7f185930cd91d2f75bcfe3a30f604623/docker-install.sh"
chmod +x docker-install.sh
bash docker-install.sh
if [ $? != 0 ]; then
echo "Failed to install docker!"
exit
fi
version=$(basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/home-assistant/os-agent/releases/latest))
if [[ $(uname -m) == "arm"* ]]
then
wget -O os-agent.deb "https://github.com/home-assistant/os-agent/releases/download/$version/os-agent_$(echo $version)_linux_$(uname -m).deb"
if [ $? != 0 ]; then
rm os-agent.deb
architecture=$(uname -m | grep -o -P "^(.*?)[0-9]+")
wget -O os-agent.deb "https://github.com/home-assistant/os-agent/releases/download/$version/os-agent_$(echo $version)_linux_$architecture.deb"
fi
else
wget -O os-agent.deb "https://github.com/home-assistant/os-agent/releases/download/$version/os-agent_$(echo $version)_$(uname -s)_$(uname -m).deb"
fi
dpkg -i os-agent.deb
gdbus introspect --system --dest io.hass.os --object-path /io/hass/os
if [ $? == 0 ]; then
echo "Success!"
else
echo "Failure!
Please check output
"
exit
fi
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb
if [ $? = 0 ]; then
sudo wall -n "
.++++++.
:@@+==+@@:
-@@: :@@-
=@%. .%@=
*@# #@*
#@* *@#
.%@= =@%.
.%@- .++. -@%.
:@@: -@@- :@@:
=@%. -@@- .%@=
+@# :@@: #@+
*@* @@ *@*
#@+ @@ +@#
.%@- #% -@%.
:@@: .. :@@:
-@%. :%%: .%@-
=@# -- #@=
*@* *@*
#@* *@#
*@#======================================#@*
=++++++++++++++++++++++++++++++++++++++++=
_____ ______ ____ ____ ____ _______ _____ _ _ _____
| __ \| ____| _ \ / __ \ / __ \__ __|_ _| \ | |/ ____|
| |__) | |__ | |_) | | | | | | | | | | | | \| | | __
| _ /| __| | _ <| | | | | | | | | | | | | | |_ |
| | \ \| |____| |_) | |__| | |__| | | | _| |_| |\ | |__| |
|_| \_\______|____/ \____/ \____/ |_| |_____|_| \_|\_____|
"
sleep 5s
echo "Rebooting now.."
reboot now
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment