#!/usr/bin/bash if [[ -n $(pidof crownd) ]]; then echo "crownd is running. You need to stop it before attempting to upgrade." exit fi function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } cd mkdir -p tmp cd tmp rm -f linux.tar.xz x86_64-pc-linux-gnu.tar.xz rm -rf linux x86_64-pc-linux-gnu.tar.xz if [ $(version $1) -le $(version "0.0.0.71") ]; then name="linux" else name="x86_64-pc-linux-gnu" fi wget https://github.com/Crowndev/crown/releases/download/$1/$name.tar.xz tar -xvf $name.tar.xz sudo cp $name/* /usr/local/bin cd mkdir -p .crown cd .crown if [[ -e crown.conf ]]; then echo "Not touching crown.conf" else echo "Creating crown.conf" cat >crown.conf <