diff --git a/odoo_install.sh b/odoo_install.sh index d49438e..b310d0b 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -51,12 +51,15 @@ ADMIN_EMAIL="odoo@example.com" ## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ): ## https://www.odoo.com/documentation/16.0/administration/install.html -WKHTMLTOX_X64="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_amd64.deb" -WKHTMLTOX_X32="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_i386.deb" - -## For Ubuntu 22.04 uncomment to replace the 64 bit download link above with following: -#WKHTMLTOX_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb" -#(No 32 bit version release seems to exist) +# Check if the operating system is Ubuntu 22.04 +if [[ $(lsb_release -r -s) == "22.04" ]]; then + WKHTMLTOX_X64="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb" + #No 32 bit version available for Ubuntu 22.04 +else + # For older versions of Ubuntu + WKHTMLTOX_X64="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_amd64.deb" + WKHTMLTOX_X32="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_i386.deb" +fi #-------------------------------------------------- # Update Server @@ -116,9 +119,7 @@ if [ $INSTALL_WKHTMLTOPDF = "True" ]; then fi sudo wget $_url sudo gdebi --n `basename $_url` - #For Ubuntu 22.04 replace the above line with - #sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb - + sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin else