Skip to content

Instantly share code, notes, and snippets.

@ynx0
Last active January 18, 2022 02:18
Show Gist options
  • Save ynx0/d48b8f2d83c5c0239a390193d6dd59c4 to your computer and use it in GitHub Desktop.
Save ynx0/d48b8f2d83c5c0239a390193d6dd59c4 to your computer and use it in GitHub Desktop.
updates the binary in place! make sure you back up your vere folder cause this guy deletes it
#!/usr/bin/env bash
BINARY_HOME="./urbit-bin"
OS="$(uname -s)"
case "${OS}" in
Linux*) target="linux64";;
MINGW*) target="windows";;
Darwin*) target="darwin";;
CYGWIN*) target="windows";;
*) echo "UNKNOWN:${OS}"
exit -1
;;
esac
rm -rf $BINARY_HOME
mkdir $BINARY_HOME
URL="https://github.com/urbit/urbit/releases/latest/download/$target.tgz"
echo $URL
curl -JLO $URL
tar zxvf ./$target.tgz -C $BINARY_HOME --strip=1
rm ./$target.tgz
if [[ $target = "linux64" ]]; then
if ! [[ -x "$(command -v setcap)" ]]; then
echo "run sudo setcap 'cap_net_bind_service=+ep' $BINARY_HOME/urbit after installing setcap"
fi
echo "allowing port 80 bind through setcap..."
sudo setcap 'cap_net_bind_service=+ep' $BINARY_HOME/urbit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment