blob: 75814829b550ae3d226470bb0ea7bae28e1f6e1a [file] [log] [blame]
Davide Garberi79343a82019-09-24 20:18:11 +02001#!/sbin/sh
2#
3# System mount script
4#
5
6system=$(mount | grep system | sed 's|.*on ||' | sed 's| type.*||')
7system_device=${2}
8
9if [ -d /mnt/system ]; then
10 sys_mount="/mnt/system"
11elif [ -d /system_root ]; then
12 sys_mount="/system_root"
13else
14 sys_mount="/system"
15fi;
16
17case ${1} in
18 check)
19 if [ ! -z "$system" ]; then
20 umount $system
21 fi
22 ;;
23 backup)
24 mount $system_device $sys_mount
25 ./tmp/install/bin/backuptool.sh "backup" $sys_mount/system
26 umount $sys_mount
27 ;;
28 restore)
29 mount $system_device $sys_mount -t ext4
30 ./tmp/install/bin/backuptool.sh "restore" $sys_mount/system
31 umount $sys_mount
32 ;;
33esac