-
Notifications
You must be signed in to change notification settings - Fork 19
/
fakemurk-daemon.sh
74 lines (68 loc) · 2.02 KB
/
fakemurk-daemon.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
{
until tpm_manager_client take_ownership; do
echo "failed to take ownership"
sleep 0.5
done
{
launch_racer(){
echo launching racer at "$(date)"
{
while true; do
cryptohome --action=remove_firmware_management_parameters >/dev/null 2>&1
done
} &
RACERPID=$!
}
launch_racer
while true; do
echo "checking cryptohome status"
if [ "$(cryptohome --action=is_mounted)" == "true" ]; then
if ! [ -z $RACERPID ]; then
echo "logged in, waiting to kill racer"
sleep 60
kill -9 $RACERPID
echo "racer terminated at $(date)"
RACERPID=
fi
else
if [ -z $RACERPID ]; then
launch_racer
fi
fi
sleep 10
done
} &
{
while true; do
vpd -i RW_VPD -s check_enrollment=0 >/dev/null 2>&1
vpd -i RW_VPD -s block_devmode=0 >/dev/null 2>&1
crossystem.old block_devmode=0 >/dev/null 2>&1
sleep 60
done
} &
} &
{
while true; do
if test -d "/home/chronos/user/Downloads/disable-extensions"; then
kill -9 $(pgrep -f "\-\-extension\-process") 2>/dev/null
sleep 0.5
else
sleep 5
fi
done
} &
{
while true; do
if ! [ -f /mnt/stateful_partition/fakemurk_version ]; then
echo -n "CURRENT_VERSION=14" >/mnt/stateful_partition/fakemurk_version
fi
. /mnt/stateful_partition/fakemurk_version
. <(curl https://raw.githubusercontent.com/MercuryWorkshop/fakemurk/main/autoupdate.sh)
if ((UPDATE_VERSION > CURRENT_VERSION)); then
echo -n "CURRENT_VERSION=$UPDATE_VERSION" >/mnt/stateful_partition/fakemurk_version
autoupdate
fi
sleep 20m
done
} &