freedombone-usb-canary 516B

12345678910111213
  1. #!/bin/bash
  2. PROJECT_NAME=freedombone
  3. UPTIME=$(cat /proc/uptime | awk -F '.' '{print $1}')
  4. if [ $UPTIME -gt 120 ]; then
  5. ADMIN_USER=$(cat /root/${PROJECT_NAME}-completed.txt | grep 'Admin user' | awk -F ':' '{print $2}')
  6. MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
  7. echo "USB device connected on ${DEVPATH}" | mail -s "${PROJECT_NAME} USB canary" ${MY_EMAIL_ADDRESS}
  8. echo "${ACTION}" > /tmp/usb-canary
  9. echo "${MY_EMAIL_ADDRESS}" >> /tmp/usb-canary
  10. echo "$(date)" >> /tmp/usb-canary
  11. fi