Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash Script Loading Problem on reboot #759

Open
xOnlyFadi opened this issue Apr 9, 2024 · 2 comments
Open

Bash Script Loading Problem on reboot #759

xOnlyFadi opened this issue Apr 9, 2024 · 2 comments

Comments

@xOnlyFadi
Copy link

Hi I have a problem with my motion script to run when reboot and run in background i tried custom path location and then tried /opt/wz_mini/etc/rc.local.d still no motion log on my webhook only run it manually it works

here is my bash script

#!/opt/wz_mini/bin/bash

while true
do
  ret=$(cmd waitmotion 1000 | tr -d '\0')
  #printf "$ret\n"
  if [[ "$ret" == "detect"* ]] ; then
    echo "Reporting motion!"
    curl "webhook"
    sleep 1
  else
    echo "No motion found!"
    sleep 1
  fi
done
@corbolais
Copy link

Hi @xOnlyFadi ,

Here, the scripts are located in '/opt/wz_mini/etc/rc.local.d/', file name like 'motion.sh' or 'motion'. For the latter to work, you have to patch '/opt/wz_mini/etc/init.d/wz_init.sh' line 52ff. to look like:

*)
# No sh extension, so fork subprocess.
sh $i start

(just put the "sh" in front of the line)

HTH

@xOnlyFadi
Copy link
Author

Hi, @corbolais

Can you show an example inside /opt/wz_mini/etc/init.d/wz_init.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants