shell-host/install/common/ungoogled-chromium/ungoogled.inst

60 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
ungoogled_install() {
module_load confirm
module_load helpers
SDIR=$(adirname ${1:-$(dirname ${BASH_SOURCE[0]})})
if [[ ! $(which lastversion) ]]; then
echo lastversion is not installed
echo it is a required dependency for this script
echo see https://github.com/dvershinin/lastversion
return
fi
CUR_VERSION=$( /usr/bin/chromium -version | grep -oP '(?<=Chromium )[^ ]*')
_repo="Eloston/ungoogled-chromium-binaries"
NEW_VERSION=$(lastversion ${_repo})
echo "Ungoogled: Current Version : $CUR_VERSION => New Version: $NEW_VERSION"
[[ $NEW_VERSION = $CUR_VERSION ]] && [[ ! ${1} == "-f" ]] && echo Latest version is already installed
_temp=/tmp/ungoogled_chromium
echo $_temp to download deb and install
mkdir -p $_temp || exit &> /dev/null
pushd $_temp &> /dev/null || exit
echo downloading common deb
lastversion ${_repo} --format assets --filter common_ -d common.deb
lastversion ${_repo} --format assets --filter mium_.+amd64.deb -d chromium.deb
echo installing common libraries
sudo dpkg -i common.deb
echo installing ungoogled-chromium
sudo dpkg -i chromium.deb
echo done installing, removing $_temp
rm -r $_temp &> /dev/null || true
popd >/dev/null
confirm "do you want to install WidevineCDM for digital streaming rights?"
if [ $? -eq 0 ]; then
module_load widevine-install
widevine_install
fi
confirm "do you want to install the uci chromium start script in /opt/bin ?"
if [ $? -eq 0 ]; then
module_load chromium-install
chromium_install
fi
}
# # if script was executed then call the function
(return 0 2>/dev/null) || ungoogled_install $@