#!/bin/bash set -e echo "Preparing device for mode: $1" if [ $1 == 'mp' ] then # disable IKS IPADDR=`cat IPADDR` echo "Disable IKS for $IPADDR" adb connect $IPADDR:5555 adb devices echo "Waiting for device" adb wait-for-device echo "adb -s $IPADDR:5555 shell \"echo 0 > /sys/kernel/bL_switcher/active\"" adb -s $IPADDR:5555 shell "echo 0 > /sys/kernel/bL_switcher/active" adb -s $IPADDR:5555 shell "cat /sys/kernel/bL_switcher/active" fi if [ $1 == 'iks' ] then # enable IKS IPADDR=`cat IPADDR` echo "Enable IKS for $IPADDR" adb connect $IPADDR:5555 adb devices echo "Waiting for device" adb wait-for-device echo "adb -s $IPADDR:5555 shell \"echo 1 > /sys/kernel/bL_switcher/active\"" adb -s $IPADDR:5555 shell "echo 1 > /sys/kernel/bL_switcher/active" adb -s $IPADDR:5555 shell "cat /sys/kernel/bL_switcher/active" fi exit 0