scripts

My personal collection of scripts
git clone git://src.gearsix.net/scriptsscripts.zip
Log | Files | Refs | Atom | README | LICENSE

tutanota-update.sh (raw) (710B)


   1 #!/usr/bin/env sh
   2 
   3 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
   4 	echo "tutanota-update [installdir]"
   5 	echo "Download & install the latest linux desktop AppImage"
   6 	echo "from mail.tutanota.com."
   7 	echo ""
   8 	echo "Arguments:"
   9 	echo "- [installdir] is the directory to move the downloaded"
  10 	echo "  binary to. Default: '/usr/local/bin'."
  11 	exit
  12 fi
  13 
  14 if [ "$(whoami)" != "root" ]; then
  15 	echo "root priviledges required"
  16 	exit
  17 fi
  18 
  19 INSTALL="/usr/local/bin"
  20 if [ "$1" != "" ]; then INSTALL="$1"; fi
  21 OUTBIN="$INSTALL/tutanota"
  22 DWNBIN="./tutanota-desktop-linux.AppImage"
  23 GETURL="https://mail.tutanota.com/desktop/$DWNBIN"
  24 
  25 echo "fetching latest binary..."
  26 wget --quiet "$GETURL"
  27 install "$DWNBIN" "$OUTBIN"
  28 rm "$DWNBIN"