lbry-sdk/lbrynet/lbrynet_daemon/scripts/update_lbrynet.sh
Jack 20b516b5fa automatic updates
Adds automatic updates to lbrynet-daemon, this will check if the
installed versions of LBRY applications as well as the lbrynet python
installation are up to date. If they aren’t, it downloads the new
versions, installs them, and restarts the daemon.
2016-02-16 13:39:08 -05:00

32 lines
No EOL
780 B
Bash

#!/bin/sh
lbrynet_directory="/Users/${SUDO_USER}/Library/Application Support/lbrynet"
current_version=$(git ls-remote https://github.com/lbryio/lbry.git | grep HEAD | cut -f 1)
if [ -d "$lbrynet_directory" ]; then
if [ -f "${lbrynet_directory}/lbrynet_version.txt" ]; then
if grep -Fxq "$current_version" "${lbrynet_directory}/lbrynet_version.txt"; then
echo "LBRYnet version $current_version is up to date"
exit
fi
fi
fi
tmp=$(mktemp -d)
cd $tmp
echo "Downloading LBRYnet update"
git clone --depth 1 https://github.com/lbryio/lbry.git &>/dev/null
cd lbry
echo "Installing update"
sudo python setup.py install &>/dev/null
mkdir -p "$lbrynet_directory"
echo $current_version > "${lbrynet_directory}/lbrynet_version.txt"
echo "Cleaning up"
cd ../../
rm -rf $tmp