diff --git a/ct/homeassistant-core-v5.sh b/ct/homeassistant-core-v5.sh index 010d5ee2..5ac794f1 100644 --- a/ct/homeassistant-core-v5.sh +++ b/ct/homeassistant-core-v5.sh @@ -317,10 +317,11 @@ function install_script() { function update_script() { PY=$(ls /srv/homeassistant/lib/) IP=$(hostname -I | awk '{print $1}') - UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 3 \ + UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 4 \ "1" "Initialize" OFF \ "2" "Update Core" ON \ "3" "Install HACS" OFF \ + "4" "Install FileBrowser" OFF \ 3>&1 1>&2 2>&3) if [ "$UPD" == "1" ]; then @@ -373,6 +374,35 @@ msg_ok "Installed Home Assistant Comunity Store (HACS)" echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n" exit fi +if [ "$UPD" == "4" ]; then +clear +header_info +msg_info "Installing FileBrowser" +curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null +filebrowser config init -a '0.0.0.0' &>/dev/null +filebrowser config set -a '0.0.0.0' &>/dev/null +filebrowser users add admin changeme --perm.admin &>/dev/null +msg_ok "Installed FileBrowser on $hostname" + +msg_info "Creating Service" +service_path="/etc/systemd/system/filebrowser.service" +echo "[Unit] +Description=Filebrowser +After=network-online.target +[Service] +User=root +WorkingDirectory=/root/ +ExecStart=/usr/local/bin/filebrowser -r / +[Install] +WantedBy=default.target" >$service_path + +systemctl enable --now filebrowser.service &>/dev/null +msg_ok "Created Service" + +msg_ok "Completed Successfully!\n" +echo -e "FileBrowser should be reachable by going to the following URL. + ${BL}http://$IP:8080${CL} \n" +exit } clear if ! command -v pveversion >/dev/null 2>&1; then update_script; else install_script; fi