diff --git a/ct/inventree.sh b/ct/inventree.sh index f66e18a40..5c22d2456 100644 --- a/ct/inventree.sh +++ b/ct/inventree.sh @@ -20,19 +20,19 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -d "/opt/inventree" ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP" - $STD apt-get update - $STD apt-get install --only-upgrade inventree -y - msg_ok "Updated $APP" + if [[ ! -d "/opt/inventree" ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP" + $STD apt update + $STD apt install --only-upgrade inventree -y + msg_ok "Updated $APP" + exit } start @@ -42,4 +42,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" diff --git a/ct/mysql.sh b/ct/mysql.sh index 66224e0e2..e113d595f 100644 --- a/ct/mysql.sh +++ b/ct/mysql.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-13}" +var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /usr/share/keyrings/mysql.gpg ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD apt update - $STD apt -y upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -f /usr/share/keyrings/mysql.gpg ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating ${APP} LXC" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Successfully" + exit } start @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following IP:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}${IP}:3306${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}${IP}:3306${CL}" diff --git a/ct/omv.sh b/ct/omv.sh index 29f1cd87f..ec824d41c 100644 --- a/ct/omv.sh +++ b/ct/omv.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-13}" +var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,18 +20,18 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP} LXC" - $STD apt update - $STD apt -y upgrade - msg_ok "Updated Successfully" + header_info + check_container_storage + check_container_resources + if [[ ! -f /etc/apt/sources.list.d/openmediavault.list ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating ${APP} LXC" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Successfully" + exit } start @@ -41,4 +41,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" diff --git a/ct/technitiumdns.sh b/ct/technitiumdns.sh index 1a0eeb89b..9ed624665 100644 --- a/ct/technitiumdns.sh +++ b/ct/technitiumdns.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-13}" +var_version="${var_version:-12}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" diff --git a/install/inventree-install.sh b/install/inventree-install.sh index aba26f1be..2863d0d08 100644 --- a/install/inventree-install.sh +++ b/install/inventree-install.sh @@ -13,28 +13,51 @@ setting_up_container network_check update_os +msg_info "Detecting Distro" +DISTRO_OS=$(awk -F= '/^ID=/{print $2}' /etc/os-release) +DISTRO_VER=$(awk -F= '/^VERSION_ID=/{print $2}' /etc/os-release | tr -d '"') + +case "$DISTRO_OS" in +debian) + if [[ "$DISTRO_VER" == "12" ]]; then + DISTRO_VER="11" + fi + ;; +ubuntu) + if [[ "$DISTRO_VER" == "22.04" ]]; then + DISTRO_VER="20.04" + NEEDS_LIBSSL1_1=true + fi + ;; +esac +msg_ok "Detected $DISTRO_OS $DISTRO_VER" + msg_info "Installing Dependencies" -temp_file=$(mktemp) -curl -fsSL "http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb" -o "$temp_file" -$STD dpkg -i $temp_file +if [[ "${NEEDS_LIBSSL1_1:-false}" == "true" ]]; then + echo "deb http://security.ubuntu.com/ubuntu focal-security main" >/etc/apt/sources.list.d/focal-security.list + $STD apt update + $STD apt install -y libssl1.1 + rm -f /etc/apt/sources.list.d/focal-security.list +fi msg_ok "Installed Dependencies" msg_info "Setting up InvenTree Repository" mkdir -p /etc/apt/keyrings curl -fsSL https://dl.packager.io/srv/inventree/InvenTree/key | gpg --dearmor -o /etc/apt/keyrings/inventree.gpg -echo "deb [signed-by=/etc/apt/keyrings/inventree.gpg] https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 main" >/etc/apt/sources.list.d/inventree.list +echo "deb [signed-by=/etc/apt/keyrings/inventree.gpg] https://dl.packager.io/srv/deb/inventree/InvenTree/stable/${DISTRO_OS} ${DISTRO_VER} main" \ + >/etc/apt/sources.list.d/inventree.list +$STD apt update msg_ok "Set up InvenTree Repository" -msg_info "Setup ${APPLICATION} (Patience)" -$STD apt-get update -$STD apt-get install -y inventree -msg_ok "Setup ${APPLICATION}" +msg_info "Installing InvenTree" +$STD apt install -y inventree || msg_error "Failed to install InvenTree" +msg_ok "Installed InvenTree" motd_ssh customize msg_info "Cleaning up" -rm -f $temp_file -$STD apt-get -y autoremove -$STD apt-get -y autoclean +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean msg_ok "Cleaned" diff --git a/install/mysql-install.sh b/install/mysql-install.sh index 44dcbcd76..404f2957d 100644 --- a/install/mysql-install.sh +++ b/install/mysql-install.sh @@ -63,27 +63,7 @@ msg_ok "MySQL Server configured" read -r -p "${TAB3}Would you like to add PhpMyAdmin? " prompt if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then - msg_info "Installing phpMyAdmin" - $STD apt install -y \ - apache2 \ - php \ - php-mysqli \ - php-mbstring \ - php-zip \ - php-gd \ - php-json \ - php-curl - - curl -fsSL "https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.tar.gz" -o "phpMyAdmin-5.2.2-all-languages.tar.gz" - mkdir -p /var/www/html/phpMyAdmin - tar xf phpMyAdmin-5.2.2-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpMyAdmin - cp /var/www/html/phpMyAdmin/config.sample.inc.php /var/www/html/phpMyAdmin/config.inc.php - SECRET=$(openssl rand -base64 24) - sed -i "s#\$cfg\['blowfish_secret'\] = '';#\$cfg['blowfish_secret'] = '${SECRET}';#" /var/www/html/phpMyAdmin/config.inc.php - chmod 660 /var/www/html/phpMyAdmin/config.inc.php - chown -R www-data:www-data /var/www/html/phpMyAdmin - systemctl restart apache2 - msg_ok "Installed phpMyAdmin" + bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/phpmyadmin.sh)" fi msg_info "Start Service"