Results 1 to 10 of 10
Alright, I'm doing something like this:
1. Run a script from an external media device.
2. Have that script put another script into the $HOME folder.
3. Launch a script ...
- 09-15-2007 #1
A script ran from the device to unmount the device: I'm having problems
Alright, I'm doing something like this:
1. Run a script from an external media device.
2. Have that script put another script into the $HOME folder.
3. Launch a script from the $HOME folder to umount the device.
Apparently, this sounds logical.
For instance, the terminal is being told to launch the script from the home directory and not the device. I set these scripts up so that no script should be running from the device. Unfortunately, it seems as though something is running when nothing should be at all. I don't get why...
If it's any consolation, I'm using Ubuntu. I've known Ubuntu to act a little different with terminal commands, so that might be something.
File1.sh --> on external device
rerouting.sh ---> in $HOME/folder/Code:#!/bin/sh mkdir $HOME/folder cp -r ./folder/* $HOME/folder/ bash $HOME/folder/rerouting.sh
unmount-device.sh ---> in $HOME/folder/Code:#!/bin/sh bash $HOME/folder/unmount-device.sh
Despite the fact that it doesn't look like the last script is unmounting external device, I guess terminal thinks the device is active. To say the least, the device is not. I have nautilus closed during all of this. I just have a terminal window open.Code:#!/bin/sh sudo umount /dev/xyz*
I think the device may be active because the terminal is somehow linking all of these scripts from the original one. If so, why doesn't it simply forget that it was previous at the first script, unload it, release it, and forget it even existed?
- 09-15-2007 #2
- 09-15-2007 #3
- 09-15-2007 #4
- 09-15-2007 #5As a note, the device is automatically mounted when inserted into the USB port.Code:
umount: /media/disk: device is busy umount: /media/disk: device is busy
The device did not manually require a mount command.
- 09-15-2007 #6
- 09-15-2007 #7
It runs from the PC.
I feel as though things are going wrong because the process is going like this:
Instead of...external device (A) --> (B) --> (C)
However, I don't know why the process would be going from A to B to C (as in the first logical diagram).external device (A) --> (B) PC
PC (B) --> (C)
As another note, if I manually execute the script from the PC instead of the device, the script unmounts the device.
That's why I've been feeling the scripts are somehow still pseudo-executing from the external device, which doesn't make sense.
I guess it makes sense if there is a flaw in the way the shell is made.
- 09-15-2007 #8
- 09-15-2007 #9
Impossible. I don't believe that.
I've done this with a reboot of a live-cd.
Is anyone able to do something like this with an external device?
- 09-15-2007 #10Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521


Reply With Quote
