Skip to content
Browse files

automatically stopping PirateBox service before unmounting USB disk

  • Loading branch information...
1 parent fcbd5c1 commit 75794ae7ca1527a3c0a7ac465896e06fdbe754b4 @cr committed Jan 31, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/data/etc/piratebox.common
View
9 src/data/etc/piratebox.common
@@ -78,7 +78,14 @@ pb_umount() {
pb_ismounted "$pb_extmount" || continue
if ! umount "$pb_extmount"
then
- echo "${initscript}: WARNING: unable to umount ext image" >&2
+ # PirateBox might still be running, so...
+ # silently try to stop PirateBox service
+ pb_stop &>/dev/null
+ sleep 2
+ if ! umount "$pb_extmount"
+ then
+ echo "${initscript}: WARNING: unable to umount ext image" >&2
+ fi
fi
losetup -d /dev/loop0
;;

0 comments on commit 75794ae

Please sign in to comment.
Something went wrong with that request. Please try again.