~michael-sheldon/ubuntu-touch-session/fix-1659388

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
description "Factory Wipe Watcher"
author "Ricardo Mendoza <ricmm@ubuntu.com>"

start on started lightdm and file FILE=/userdata/.factory_wipe

task

script
    # Factory requirement to shutdown the phone if it's booting
    # after the production factory reset happened (see recovery)
    if [ -e /userdata/.factory_wipe ]; then
        sleep 45
        rm /userdata/.factory_wipe
        echo u > /proc/sysrq-trigger
        sleep 1
        poweroff -fp
    fi
end script