1

Yes, that title is a complete mess. I didn't really know how else to describe it.

I'm setting up my RPi to run Homebridge in a screen on startup. I've edited my rc.local file to include this line:

su - pi -c "screen -dm -S hbscreen homebridge"

It creates a screen called "hbscreen" which executes the command "homebridge". Now the problem is that I'd like to add an argument so the command reads "homebridge -I".

Seeing as I like to just try things I simply added -I to the line and got this:

su - pi -c "screen -dm -S hbscreen homebridge -I"

But suddenly my RPi wouldn't boot anymore. So, I guess that wasn't the right way to go about it.

I've been googling for half an hour now and I can't seem to figure it out. What would be the correct notation? I'm guessing I need to let it know "homebridge -I" is one piece, but I'm assuming I can't use quotation marks within quotation marks like this:

su - pi -c "screen -dm -S hbscreen "homebridge -I""

3
  • What if you use single quotes instead of the inner double quotes? Also, you can escape the double quotes as \". Commented Sep 15, 2018 at 18:00
  • @UltraInstinct Just tried escaping the double quotes, didn't work sadly. I restarted my Pi and the screen didn't even start up. Commented Sep 15, 2018 at 19:07
  • Forgot to add that I also tried the single quotes, same result. RPi would boot but no screen would have been started. Removing the quotes and -I makes everything run fine, but I need the -I for additional features. Commented Sep 15, 2018 at 19:22

1 Answer 1

1

Thanks to someone on Reddit I managed to fix it by not putting everything in rc.local but instead making an .sh file in my home directory called hbboot.sh and running that instead.

rc.local:

su - pi -c "screen -dm -S hbscreen ~/hbboot.sh"

hbboot.sh:

#!/bin/sh
homebridge -I "$@"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.