#!/bin/bash echo "Please enter password to install testing tools" sudo apt-get install -y coreutils mtr-tiny gist OUTPUT=$(/bin/mktemp /tmp/SNAPDEBUG.XXXX.txt) { set -x cd /tmp date -R lsb_release -a snap version snap changes snap whoami # test routing to API server mtr --report-wide api.snapcraft.io SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=9 snap download hello SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=9 snap download core } | tee ${OUTPUT} echo -n "Press y to upload to gist or press n to save result txt file: " read ans if [ $ans == "y" ] ; then gist-paste -p ${OUTPUT} else echo "Please send ${OUTPUT} to Canonical" fi