need help writing a script
ok here's the jist of the problem...
Im using mjpg_streamer for live video over a network, how-ever for some reason it gets buffer errors which i cannot seem to fix, no biggie, all that happens is the proccess quits, which kills the video feed.. I have made a service script that will check if the proccess is running and if it is it does nothing, if its not running, it'll restart it... Now i wanted to add it to cron but thats pointless as cron works only every minute, not seconds.. Im wanting someone to help me write a simple script that will run the service i have created every 20 seconds or so... I have no idea howto etc... the current script is one i found online and changed a few things too... how do i go about this... google only returns info that is useless to me because i dont understand what they are trying to do etc... |
Hello,
I think the simplest solution is to run your commands using a loop structure in combination with a sleep command. Have a look at this man page for sleep. It might also help us if you post what you have got as script. Kind regards, Eric |
You could throw the 'sleep' command in your script.
|
here's my script - its also a service
Code:
#!/bin/bash |
Code:
while 1 |
Quote:
Code:
mjpg-restarter.sh: 7: 1: not found |
My bad, forgot the brackets. Place some round brackets around the 1
|
Or use while true
|
Thanks for the help guys...
got it working... using the 1 method didnt work, but swapping it for the "true" statement has.... Cheers guys |
All times are GMT -5. The time now is 06:14 PM. |