#!/bin/bash set -e CAT_DEV=/dev/ttyS2 CAT_DEV_NEW=/dev/ttyS2_VIRT function cleanup() { echo 0 > /sys/class/gpio/gpio138/value if [ -e "/mnt/x6100/${CAT_DEV}" ] ; then umount /mnt/x6100/${CAT_DEV} || true fi if [ -f "/mnt/x6100/${CAT_DEV}" ] ; then rm /mnt/x6100/${CAT_DEV} fi } trap cleanup EXIT trap cleanup SIGINT if grep -r "x6100_app_hide=1" /proc/cmdline > /dev/null ; then cat > /root/qtkmsconfig.json < /root/qtkmsconfig.json < /sys/class/gpio/gpio138/value chroot /mnt/x6100 /bin/bash -c 'source /etc/profile && nice --5 /usr/app_qt/x6100_ui_v100'