#!/bin/bash RUNTIME_DIR=/tmp/aif LOG_DIR=/var/log/aif source /usr/lib/libui.sh cat - </dev/null ls -lh $LOG_DIR/* 2>/dev/null report="Uploaded data:" if ask_yesno "Send these files?" then shopt -s nullglob for i in $RUNTIME_DIR/* $LOG_DIR/* do bin=$(cat $i | curl -sF 'sprunge=<-' http://sprunge.us) bin=${bin/ /} # for some reason there is a space in the beginning report="$report\n$i $bin" done fi echo "It can also be useful to upload a list of currently mounted filesystems:" df -hT if ask_yesno "Is this ok?" then bin=$(df -hT | curl -sF 'sprunge=<-' http://sprunge.us) bin=${bin/ /} report="$report\ndf -hT $bin" fi echo -e "$report" echo "For your convenience, I will paste the report online" echo "So you just need to give the following url:" echo -e "$report" | curl -sF 'sprunge=<-' http://sprunge.us