diff --git a/src/freedombone-upgrade b/src/freedombone-upgrade index 33f73ab4..94c408ca 100755 --- a/src/freedombone-upgrade +++ b/src/freedombone-upgrade @@ -61,6 +61,11 @@ if [ $DEVELOPMENT_BRANCH ]; then fi fi +# upgrading file prevents USB canary from activating +if [ ! -f /tmp/.upgrading ]; then + touch /tmp/.upgrading +fi + if [ -f /usr/bin/backupdatabases ]; then if grep -q "cat /root/dbpass" /usr/bin/backupdatabases; then # update to using the password manager @@ -91,6 +96,7 @@ if [ -d "$PROJECT_DIR" ]; then fi if ! ${PROJECT_NAME} -c "$CONFIGURATION_FILE"; then + rm /tmp/.upgrading exit 453536 fi @@ -118,4 +124,9 @@ fi # If logging was left on then turn it off ${PROJECT_NAME}-logging off +# upgrading file prevents USB canary from activating +if [ -f /tmp/.upgrading ]; then + rm /tmp/.upgrading +fi + # deliberately there is no 'exit 0' here diff --git a/src/freedombone-usb-canary b/src/freedombone-usb-canary index 6fd7f382..a165fd40 100755 --- a/src/freedombone-usb-canary +++ b/src/freedombone-usb-canary @@ -28,12 +28,14 @@ PROJECT_NAME=freedombone -UPTIME=$(awk -F '.' '{print $1}' < "/proc/uptime") -if [ "$UPTIME" -gt 240 ]; then - ADMIN_USER=$(grep 'Admin user' /root/${PROJECT_NAME}-completed.txt | awk -F ':' '{print $2}') - MY_EMAIL_ADDRESS=${ADMIN_USER}@$(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 - date >> /tmp/usb-canary +if [ ! -f /tmp/.upgrading ]; then + UPTIME=$(awk -F '.' '{print $1}' < "/proc/uptime") + if [ "$UPTIME" -gt 240 ]; then + ADMIN_USER=$(grep 'Admin user' /root/${PROJECT_NAME}-completed.txt | awk -F ':' '{print $2}') + MY_EMAIL_ADDRESS=${ADMIN_USER}@$(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 + date >> /tmp/usb-canary + fi fi