Skip to content
Snippets Groups Projects
Commit c759f793 authored by Bob Mottram's avatar Bob Mottram
Browse files

Don't trigger usb canary if recently rebooted

parent 30a181f7
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,13 @@
PROJECT_NAME=freedombone
ADMIN_USER=$(cat /root/${PROJECT_NAME}-completed.txt | grep 'Admin user' | awk -F ':' '{print $2}')
#MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
MY_EMAIL_ADDRESS=root@$(cat /etc/hostname)
echo "USB device connected on ${DEVPATH}" | mail -s "${PROJECT_NAME} USB canary" ${MY_EMAIL_ADDRESS}
echo "${ACTION}" > /tmp/usb-canary
echo "${MY_EMAIL_ADDRESS}" >> /tmp/usb-canary
echo "$(date)" >> /tmp/usb-canary
UPTIME=$(cat /proc/uptime | awk -F '.' '{print $1}')
if [ $UPTIME -gt 120 ]; then
ADMIN_USER=$(cat /root/${PROJECT_NAME}-completed.txt | grep 'Admin user' | awk -F ':' '{print $2}')
#MY_EMAIL_ADDRESS=${ADMIN_USER}@$(cat /etc/hostname)
MY_EMAIL_ADDRESS=root@$(cat /etc/hostname)
echo "USB device connected on ${DEVPATH}" | mail -s "${PROJECT_NAME} USB canary" ${MY_EMAIL_ADDRESS}
echo "${ACTION}" > /tmp/usb-canary
echo "${MY_EMAIL_ADDRESS}" >> /tmp/usb-canary
echo "$(date)" >> /tmp/usb-canary
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment