/hlc_download.sh Secret
Last active
February 2, 2021 16:18
-
-
Save Sh4der/8476895a0863ca6062103315ac122954 to your computer and use it in GitHub Desktop.
Download the latest version of Hermes Led Control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ "$EUID" -ne 0 ]] | |
then echo "Please run as root" | |
exit | |
fi | |
#url=$(curl --silent "https://api.github.com/repos/project-alice-assistant/HermesLedControl/releases/latest" | grep -Po '"tarball_url": "\K.*?(?=")') | |
url=https://api.github.com/repos/project-alice-assistant/HermesLedControl/tarball/v2.0.10 | |
#latest=$(curl --silent "https://api.github.com/repos/project-alice-assistant/HermesLedControl/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') | |
latest=v2.0.10 | |
path='/home/'$(logname) | |
dest=${path}/hermesLedControl_${latest} | |
rm ${latest} | |
rm -rf ${dest} | |
mkdir -p ${dest} | |
wget ${url} | |
tar -xzf ${latest} -C ${dest} --strip-components=1 | |
rm ${latest} | |
chown -R $(logname) ${dest} | |
cd ${dest} | |
chmod +x install.sh | |
./install.sh ${latest} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment