check if backing store exists beforehand
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
parent
b298d02d87
commit
4c3b75801a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue