Results 1 to 6 of 6
Hi , just wondering , ive searched around some now,
Im trying to make a bash script that restarts ./ventrilo_srv every 24 hours,
any good idea of how to ?
...
- 03-12-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 8
Bash - Auto restarter for Ventrilo every 24 hours.
Hi , just wondering , ive searched around some now,
Im trying to make a bash script that restarts ./ventrilo_srv every 24 hours,
any good idea of how to ?
Its going to restart every day at 06:00 ^^
I know that this is very basic but ive just started php + mysql so i have to ask for this script
Thanks in advance!
- 03-13-2007 #2Just Joined!
- Join Date
- Mar 2007
- Posts
- 8
Hi again, i forgot to tell you that im using SCREEN.
So is there a script that can restart my VT server every 24 hours?
automaticly..
- 03-13-2007 #3Just Joined!
- Join Date
- Mar 2007
- Posts
- 8
So anyone who know some basic bash scripting ?
If linux had GOTO i would have done it like this..
:startserver
echo "Starter Ventrilo server"
screen -A -m -d -S Ventrilo ./ventrilo_srv
#example for how long to wait until to goto the shutdown step.
sleep 10
:startshutdown
screen -r Ventrilo
quit
goto startserver
- 03-16-2007 #4
- 03-17-2007 #5Yes. Add a cron job which restarts it every day at 6:00. That's actually what cron is for.
Originally Posted by likwid Gotos are generally considered evil, and I've never come across an instance where they were necessary. Here's a workaround:
Originally Posted by peec Keep in mind the only thing I've changed is the labels and the gotos. It's now an infinity loop via 'while'.Code:while : ; do echo "Starter Ventrilo server" screen -A -m -d -S Ventrilo ./ventrilo_srv #example for how long to wait until to goto the shutdown step. sleep 10 screen -r Ventrilo quit done
- 03-17-2007 #6Just Joined!
- Join Date
- Mar 2007
- Posts
- 8
Why not just a single executable file, restart_vento.sh
Then in your crontabs, run restart_vento.sh every day at 6amCode:#!/bin/sh # Stop vento? echo "Stoping Ventrilo server" screen -r Ventrilo # Wait a while until we start it again echo "Waiting a while..." sleep 10 # Start vento echo "Starting Ventrilo server" # Assuming "screen" follows the general rules for return values of int main(...) # the echo will only run when vetrilo is successfully started. screen -A -m -d -S Ventrilo ./ventrilo_srv && echo "Ventrilo server started successfully."


Reply With Quote