mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-13 16:18:52 +01:00
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 () {
|
start_share () {
|
||||||
|
|
||||||
# 1) Check if the backing store partition is already shared
|
# 1) Check if 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"
|
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
|
# 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"
|
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
|
# Return if currently sharing
|
||||||
is_share_started () {
|
is_share_started () {
|
||||||
|
|
||||||
|
if [ ! -e $BACKING_STORE_FILE ]; then
|
||||||
|
echo "no"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
cat $BACKING_STORE_FILE | egrep -q ^/dev/mmcblk0p3
|
cat $BACKING_STORE_FILE | egrep -q ^/dev/mmcblk0p3
|
||||||
local res=$?
|
local res=$?
|
||||||
if [ "$res" == "0" ]; then
|
if [ "$res" == "0" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user