PRIVATEBIN_VERSION="1.1" PRIVATEBIN_SOURCE_URL="https://github.com/PrivateBin/PrivateBin/archive/${PRIVATEBIN_VERSION}.tar.gz" PRIVATEBIN_SOURCE_SHA256="61d18753c792d83f54ad9e414d1d32198ab873054907081e732effd5ccbe96ef" extract_source() { local DESTDIR=$1 # retrieve and extract Roundcube tarball rc_tarball="${DESTDIR}/privatebin.tar.gz" sudo wget -q -O "$rc_tarball" "$PRIVATEBIN_SOURCE_URL" \ || ynh_die "Unable to download source tarball" echo "$PRIVATEBIN_SOURCE_SHA256 $rc_tarball" | sha256sum -c >/dev/null \ || ynh_die "Invalid checksum of downloaded tarball" sudo tar xf "$rc_tarball" -C "$DESTDIR" --strip-components 1 \ || ynh_die "Unable to extract source tarball" sudo rm "$rc_tarball" } ynh_secure_rm () { [[ "/var/www /opt /home/yunohost.app" =~ $1 ]] \ || (test -n "$1" && sudo rm -Rf $1 ) }