mirror of
https://github.com/ncarlier/webhookd.git
synced 2024-09-20 08:55:28 +00:00
chore(): non root installation script
This commit is contained in:
parent
e663336ecb
commit
b68a3fa911
24
install.sh
Normal file → Executable file
24
install.sh
Normal file → Executable file
|
@ -24,22 +24,22 @@ base_download_url=`dirname $artefact_url`
|
||||||
|
|
||||||
download_url=$base_download_url/webhookd-$os-${arch}.tgz
|
download_url=$base_download_url/webhookd-$os-${arch}.tgz
|
||||||
download_file=/tmp/webhookd-$os-${arch}.tgz
|
download_file=/tmp/webhookd-$os-${arch}.tgz
|
||||||
bin_target=/usr/local/bin
|
bin_target=${1:-$HOME/.local/bin}
|
||||||
|
|
||||||
echo "Downloading $download_url to $download_file ..."
|
echo "Downloading $download_url to $download_file ..."
|
||||||
sudo curl -o $download_file --fail -L $download_url
|
curl -o $download_file --fail -L $download_url
|
||||||
[ $? != 0 ] && die "Unable to download binary for your architecture."
|
[ $? != 0 ] && die "Unable to download binary for your architecture."
|
||||||
|
|
||||||
echo "Extracting $download_file ..."
|
echo "Extracting $download_file to $bin_target ..."
|
||||||
sudo tar xvzf ${download_file} -C /tmp/
|
[ -d $bin_target ] || mkdir -p $bin_target
|
||||||
|
tar xvzf ${download_file} -C $bin_target
|
||||||
[ $? != 0 ] && die "Unable to extract archive."
|
[ $? != 0 ] && die "Unable to extract archive."
|
||||||
|
|
||||||
echo "Moving binary to $bin_target ..."
|
echo "Cleaning..."
|
||||||
sudo mv /tmp/webhookd $bin_target
|
rm $download_file \
|
||||||
[ $? != 0 ] && die "Unable to move binary."
|
$bin_target/LICENSE \
|
||||||
|
$bin_target/README.md \
|
||||||
|
$bin_target/CHANGELOG.md
|
||||||
|
[ $? != 0 ] && die "Unable to clean installation files."
|
||||||
|
|
||||||
echo "Making $bin_target as executable ..."
|
echo "Installation done. Type '$bin_target/webhookd' to start the server."
|
||||||
sudo chmod +x $bin_target/webhookd
|
|
||||||
[ $? != 0 ] && die "Unable to make the binary as executable."
|
|
||||||
|
|
||||||
echo "Installation done. Type 'webhookd' to start the server."
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user