-
Notifications
You must be signed in to change notification settings - Fork 11
/
S99treconfig.sh
executable file
·54 lines (49 loc) · 1.37 KB
/
S99treconfig.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
#!/bin/sh
if [ -z "$1" ] || [ "x$1" = "xstart" ]; then
if [ -f /media/data/.reconfig ] && [ -f /media/data/.finish ]; then
exit 1
fi
if [ ! -r /media/data/.reconfig ] && [ -f /media/data/.finish ]; then
rm -rf /media/data/local/etc/*
echo -n 1 >/sys/devices/virtual/vtconsole/vtcon1/bind
clear
echo "wipe old config from file system"
sleep 2
echo "done"
sleep 2
echo "The system reboot in 10s..."
sleep 10
echo -n 0 >/sys/devices/virtual/vtconsole/vtcon1/bind
touch /media/data/.reconfig
reboot
fi
if [ -f /media/data/.reconfig ] && [ ! -r /media/data/.finish ]; then
echo -n 1 >/sys/devices/virtual/vtconsole/vtcon1/bind
clear
echo "Finishing installation."
echo "This will prevent data corruption in case the console"
echo "did not shutdown properly on the first system boot."
sleep 4
echo "done"
sleep 2
echo "The system reboot in 10s..."
sleep 10
echo -n 0 >/sys/devices/virtual/vtconsole/vtcon1/bind
touch /media/data/.finish
reboot
fi
if [ ! -r /media/data/.reconfig ] && [ ! -r /media/data/.finish ]; then
rm -rf /media/data/local/etc/*
echo -n 1 >/sys/devices/virtual/vtconsole/vtcon1/bind
clear
echo "wipe old config from file system"
sleep 2
echo "done"
sleep 2
echo "The system reboot in 10s..."
sleep 10
echo -n 0 >/sys/devices/virtual/vtconsole/vtcon1/bind
touch /media/data/.reconfig
reboot
fi
fi