2022-11-13 12:13:34 +01:00
|
|
|
#!/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 command -v update-ca-trust > /dev/null; then
|
2022-12-26 18:59:30 +01:00
|
|
|
$sudo cp $run_directory/*.crt /etc/ca-certificates/trust-source/anchors/
|
2022-11-13 12:13:34 +01:00
|
|
|
$sudo update-ca-trust
|
|
|
|
elif command -v update-ca-certificates > /dev/null; then
|
2022-12-26 18:59:30 +01:00
|
|
|
$sudo cp $run_directory/*.crt /usr/local/share/ca-certificates/
|
2022-11-13 12:13:34 +01:00
|
|
|
$sudo update-ca-certificates
|
|
|
|
else
|
|
|
|
echo "No update-ca binary found. Exiting with error!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Finished install. Exiting..."
|
|
|
|
exit 0
|