Commit cf0d40df authored by Tails developers's avatar Tails developers
Browse files

No need to use absolute path here.

Using absolute paths may be needed for code that should run after the boot
medium has been removed. Only such code in this script is the do_stop function
=> no need to use absolute paths elsewhere.

On the other hand, the initscript that calls us sets a pretty scarse $PATH so we
need to add /usr/bin to it.
parent 2e1a0713
......@@ -2,6 +2,9 @@
### Helper functions
# For whatever reason, the initscript that calls us sets a pretty scarse $PATH
PATH="/usr/bin:${PATH}"
# Arg: a 'major:minor' device number.
# Returns success (0) iff this device is a loop device,
# even if not actually bound to a file.
......@@ -43,12 +46,12 @@ else
fi
ID="/dev/block/${PHYS_DEV_NUMBER}"
DEVICE=`/sbin/udevadm info --query path --path "${ID}"`
DEV_TYPE=`/sbin/udevadm info --query property --path "${ID}" | /bin/grep ID_TYPE | /usr/bin/awk -F "=" '{ print $2 }'`
DEVICE=`udevadm info --query path --path "${ID}"`
DEV_TYPE=`udevadm info --query property --path "${ID}" | grep ID_TYPE | awk -F "=" '{ print $2 }'`
# Let's be sure the CDRom can be ejected by pressing the button
if [ "$DEV_TYPE" = "cd" ]; then
/usr/bin/eject -i off "${ID}" 2>&1 >/dev/null
eject -i off "${ID}" 2>&1 >/dev/null
fi
# Start udev-watchdog and stop on clean exit.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment