Answer the question
In order to leave comments, you need to log in
How to add my script to Raspbian autoload?
Good morning everyone! I have a script, and I wrote a sh script for it.
If I start it manually, then everything works, but if I write it to rc.local, it does not start on reboot.
Script content
#!/bin/bash
/home/pi/zmp/zmp-linux-arm7 --host 192.168.88.99 --best "http://immo.date/ero.m3u"
!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser $# Make sure that the script will "exit 0" on success or$# value on error.
#
# In order to enable or disable this script just change$# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/home/pi/zmp/zmp.sh &
exit 0
Answer the question
In order to leave comments, you need to log in
First put zmp in opt as recommended.
Next, learn systemd.
Create file /etc/systemd/system/zmp-tv.service
With content:
[Unit]
Description=ZMediaProxy tv
After=network.target
[Service]
Type=simple
NonBlocking=true
WorkingDirectory=/opt
ExecStart=/opt/zmp-linux-arm7 --host "192.168.88.99" --best http://immo.date/ero.m3u
ExecStop=/usr/bin/killall -w zmp-linux-arm7
Restart=on-failure
RestartSec=10s
TimeoutSec=120s
[Install]
WantedBy=multi-user.target
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question