50ButtonsEach / fliclib-linux-dist

114 stars 19 forks source link

Shell startup script: unknown command loop #29

Open lextoc opened 8 years ago

lextoc commented 8 years ago

I'm trying to write a startup script for this for my Raspberry Pi. At this line: /home/pi/armv6l/fliclib-cpp/flic the terminal ends up with an infinite loop of unknown command. It works if I call the command directly in the terminal.

#!/bin/sh
sudo service bluetooth stop
sudo hciconfig hci0 up

echo "STARTING BLUETOOTHD"
sudo systemctl start bluetooth &

echo "STARTING DATABASE"
/home/pi/armv6l/daemon -l -f flic.sqlite3 &

echo "STARTING FLIC"
/home/pi/armv6l/fliclib-cpp/flic & # => "unknown command" happens here

echo "STARTING PYTHON SCRIPT"
python2.7 /home/pi/armv6l/fliclib-cpp/ffi/python/flic/dist/main.py

I'm not entirely sure if this is related/issue-worthy on this repo and I've been stuck for quite some time now. I was wondering if any of you had an idea why this might happen?

CheapB commented 8 years ago

Why are you running this if you want to run a python script

echo "STARTING FLIC"
/home/pi/armv6l/fliclib-cpp/flic & # => "unknown command" happens here
KaiboshOz commented 8 years ago

This is the super lazy - and is completely overkill - route (and only really done because I've used Webmin elsewhere), but I installed Webmin to my pi and added both bringing up the bluetooth adapter as well as starting bluetoothd and the daemon as tasks to run at system startup. The admittedly only couple of times I've restarted, it's all worked as expected.