#!/usr/bin/bash

source /etc/os-release
export GO=/usr/bin/go
if [[ $ID = "debian" ]]; then
	export GO=/usr/lib/go-1.18/bin/go
fi

git clone https://github.com/drakkan/sftpgo /root/sftpgo-src
cd /root/sftpgo-src
git checkout v2.2.3
$GO build -tags nogcs,nos3,noazblob,nobolt,nomysql,nopgsql,noportable,nometrics -o /usr/local/bin/sftpgo
