ShellCheck


finds bugs in your shell scripts.
You can cabal, apt, dnf, pkg or brew install it locally right now.
Paste a script to try it out:
📄
Your Editor (Ace – loading 800kb of JS)
 
#!/bin/sh

CUR_VERSION="$(dnscrypt-proxy --version)"
NEW_VERSION="$(curl -s https://github.com/jedisct1/dnscrypt-proxy/tags | grep ".gz" | cut -d '"' -f 4 | head -n 1  | sed "s/.tar.gz//g" | sed 's:/$::' | sed "s/jedisct1//g" | sed "s/dnscrypt-proxy//g" | sed "s/archive//g" | sed -e 's/\///g')"
echo "Current Version: $CUR_VERSION => New Version: $NEW_VERSION"

if [ "$NEW_VERSION" -ne "$CUR_VERSION" ]; then

  echo "Installing version $NEW_VERSION"

  pushd /tmp/

  curl -s https://github.com/jedisct1/dnscrypt-proxy/releases/latest \
  | grep "browser_download_url.*dnscrypt-proxy-freebsd_[^extended].*_amd64\.tar\.gz" \
  | cut -d ":" -f 2,3 \
  | tr -d \" \
  | wget -qi -

  tarball="$(find . -name "*freebsd_amd64.tar.gz" 2>/dev/null)"
  tar -xzf $tarball

  chmod +x dnscrypt-proxy

  sudo mv dnscrypt-proxy /usr/local/bin/

  popd

  location="$(which dnscrypt-proxy)"
  echo "dnscrypt-proxy binary location: $location"

  version="$(dnscrypt-proxy version)"
  echo "New dnscrypt-proxy binary version installed!: $version"

else
  echo Latest version already installed
fi
📄
ShellCheck Output
If you paste a script in the editor above, this window will show shellcheck output.

ShellCheck is...

A special thanks to: GitpodBashSupport Pro Route4MeSiemensper1234cavcrosbydcminterphotostructureCronitorsteve-chavezChrLaucjgibsonCelebian LLC.org loves open source BestKru

Wiki Sitemap