39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
run_directory=$(dirname $(readlink -f "$0"))
|
|
user=$(whoami)
|
|
|
|
if [ -f $run_directory/.disabled ]; then
|
|
echo "Installation is disabled. Exiting..."
|
|
exit 0
|
|
fi
|
|
|
|
if [[ $user != 'root' ]]; then
|
|
sudo="sudo"
|
|
else
|
|
sudo=""
|
|
fi
|
|
|
|
if [ $(echo $(lsb_release) | cut -d ' ' -f 1) = "LibreELEC" ]; then
|
|
cp /usr/share/kodi/system/certs/cacert.pem /storage/.kodi/userdata/cacert.pem
|
|
cat $run_directory/kto.crt >> /storage/.kodi/userdata/cacert.pem
|
|
cp $run_directory/advancedsettings.xml /storage/.kodi/userdata/
|
|
else # More classic Linux expected
|
|
if command -v update-ca-trust > /dev/null; then
|
|
$sudo cp $run_directory/*.crt /etc/ca-certificates/trust-source/anchors/
|
|
$sudo update-ca-trust
|
|
elif command -v update-ca-certificates > /dev/null; then
|
|
$sudo cp $run_directory/*.crt /usr/local/share/ca-certificates/
|
|
$sudo update-ca-certificates
|
|
elif [ -f /usr/sbin/update-ca-certificates ]; then # Debian...
|
|
$sudo cp $run_directory/*.crt /usr/local/share/ca-certificates/
|
|
$sudo update-ca-certificates
|
|
else
|
|
echo "No update-ca binary found. Exiting with error!"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "Finished install. Exiting..."
|
|
exit 0
|