diff --git a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/share b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/share index e2915ec..97e28ba 100755 --- a/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/share +++ b/Recovery/board/funkey/rootfs-overlay/usr/local/sbin/share @@ -85,7 +85,9 @@ stop_share () { start_share () { # 1) Check if the backing store partition is already shared - cat $BACKING_STORE_FILE | egrep -q ^/dev/mmcblk0p3 && die 12 "the backing store partition is already shared" + if [ -e $BACKING_STORE_FILE ]; then + cat $BACKING_STORE_FILE | egrep -q ^/dev/mmcblk0p3 && die 12 "the backing store partition is already shared" + fi # 2) Check if USB data is connected is_usb_data_connected > /dev/null 2>&1 || die 13 "USB sharing impossible, not connected to a host" @@ -101,6 +103,10 @@ start_share () { # Return if currently sharing is_share_started () { + if [ ! -e $BACKING_STORE_FILE ]; then + echo "no" + return 1 + fi cat $BACKING_STORE_FILE | egrep -q ^/dev/mmcblk0p3 local res=$? if [ "$res" == "0" ]; then