-
Notifications
You must be signed in to change notification settings - Fork 1
/
py_backup.sh
executable file
·36 lines (26 loc) · 943 Bytes
/
py_backup.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
#!/bin/sh
export HOME=`cat /etc/passwd |head -1 |cut -d':' -f 6`
# Restore the framebuffer to a working state
/usr/sbin/unlockvt > /dev/null
# Reset the console
/usr/bin/reset
# Disactivate the console on framebuffer
echo 0 > /sys/devices/virtual/vtconsole/vtcon1/bind
# Disable downscaling for future apps
if [ -f /sys/devices/platform/jz-lcd.0/allow_downscaling ] ; then
echo 0 > /sys/devices/platform/jz-lcd.0/allow_downscaling
fi
# Restore the regular key map
if [ -f /sys/devices/platform/linkdev/alt_key_map ] ; then
echo 0 > /sys/devices/platform/linkdev/alt_key_map
fi
# Stop the gravity sensor if it's loaded
/usr/sbin/gsensor --stop
# Source /etc/profile to set the environment variables
. /etc/profile
# Creating home directory for config
if [ ! -d /media/data/local/home/.py_backup ] ; then
mkdir /media/data/local/home/.py_backup
cp config.ini /media/data/local/home/.py_backup
fi
python main.py