diff --git a/lbrynet/lbrynet_daemon/scripts/restart_daemon.sh b/lbrynet/lbrynet_daemon/scripts/restart_daemon.sh new file mode 100644 index 000000000..74d4ab102 --- /dev/null +++ b/lbrynet/lbrynet_daemon/scripts/restart_daemon.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Restarting lbrynet-daemon" +sudo lbrynet-daemon \ No newline at end of file diff --git a/lbrynet/lbrynet_daemon/scripts/update_lbry.sh b/lbrynet/lbrynet_daemon/scripts/update_lbry.sh new file mode 100644 index 000000000..c56675c40 --- /dev/null +++ b/lbrynet/lbrynet_daemon/scripts/update_lbry.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +lbrycrd_directory="/Users/${SUDO_USER}/Library/Application Support/lbrycrd" + +current_version=$(git ls-remote https://github.com/jackrobison/lbrynet-app.git | grep HEAD | cut -f 1) + +if [ -d "$lbrycrd_directory" ]; then + if [ -f "${lbrycrd_directory}/lbry_app_version.txt" ]; then + if grep -Fxq "$current_version" "${lbrycrd_directory}/lbry_app_version.txt"; then + echo "LBRY version $current_version is up to date" + exit + fi + fi +fi + +echo "Updating LBRY" + +tmp=$(mktemp -d) +cd $tmp + +echo "Downloading update" +git clone https://github.com/jackrobison/lbrynet-app.git &>/dev/null +cd lbrynet-app +unzip LBRY.app.zip &>/dev/null +unzip LBRYURIHandler.app.zip &>/dev/null +unzip LBRY\ Updater.app.zip &>/dev/null + +echo "Installing update" +rm -rf /Applications/LBRY.app &>/dev/null +rm -rf /Applications/LBRYURIHandler.app &>/dev/null +rm -rf /Applications/LBRY\ Updater.app &>/dev/null + +mv -f LBRY.app /Applications +mv -f LBRYURIHandler.app /Applications +mv -f LBRY\ Updater.app /Applications + +echo "Cleaning up" + +cd ../../ +rm -rf $tmp \ No newline at end of file diff --git a/lbrynet/lbrynet_daemon/scripts/update_daemon.sh b/lbrynet/lbrynet_daemon/scripts/update_lbrynet.sh similarity index 70% rename from lbrynet/lbrynet_daemon/scripts/update_daemon.sh rename to lbrynet/lbrynet_daemon/scripts/update_lbrynet.sh index c2135c609..8d84a8f50 100644 --- a/lbrynet/lbrynet_daemon/scripts/update_daemon.sh +++ b/lbrynet/lbrynet_daemon/scripts/update_lbrynet.sh @@ -5,8 +5,8 @@ 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}/version.txt" ]; then - if grep -Fxq "$current_version" "${lbrynet_directory}/version.txt"; 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 @@ -26,12 +26,9 @@ version=$(git rev-parse HEAD) echo "Updating lbrynet" sudo python setup.py install &>/dev/null mkdir -p "$lbrynet_directory" -echo $version > "${lbrynet_directory}/version.txt" +echo $version > "${lbrynet_directory}/lbrynet_version.txt" echo "Cleaning up" cd ../../ -rm -rf $tmp - -echo "Restarting lbrynet-daemon" -sudo lbrynet-daemon \ No newline at end of file +rm -rf $tmp \ No newline at end of file