Quote:
Originally Posted by tshering
Quote:
Originally Posted by baskerville
Please note that Plato relies on /tmp/nickel-hardware-status for knowing when the USB cable is plugged.
|
I think I will simply replace
Code:
[ "$(pidof nickel | wc -w)" == "0" ] && exit
by
Code:
[ "$(pidof nickel | wc -w)" == "0" ] || [ "$(pidof plato | wc -w)" == "0" ] && exit
in plug. What do you think?
|
Well, you could write this as
Code:
pidof nickel plato > /dev/null || exit
.
But I had something else in mind:
- Don't change any script in
/usr/local/Kobo/udev/.
- Use the following function:
Code:
toggle_nickel_hardware_status() {
local fifo_path=/tmp/nickel-hardware-status
local arg=$1
if [ "$arg" == on ] ; then
while [ ! -p "$fifo_path" ] ; do
rm "$fifo_path"
mkfifo "$fifo_path"
done
elif [ "$arg" == off ] ; then
while [ ! -L "$fifo_path" ] ; do
rm "$fifo_path"
ln -s /dev/null "$fifo_path"
done
else
printf "toggle_nickel_hardware_status: invalid argument: '%s'." "$arg" >2
fi
}
to change the nature of
/tmp/nickel-hardware-status.
Quote:
Originally Posted by tshering
Actually these variables are available when KSM is running.
|
My bad.
Quote:
Originally Posted by tshering
Your script does work, when on inserts " sleep 2" after
Code:
insmod "$WIFI_MODULE_PATH"
|
The ommision of the
sleep statements is intentional: when the last
insmod ... returns,
/sys/class/net/${INTERFACE} already exists. Do you know why the sleep statement was introduced?
Quote:
Originally Posted by tshering
As for plato.sh, if you run "./nickel.sh &" only if nickel was running before you launched plato, KSM could simply call this plato.sh. Then I would not need to change my calling script each time you change plato.sh.
|
I'll amend the script accordingly.