update all the servers through one virtual servers using Storage are network virtual machine

Posted by Mr.Calm on Server Fault See other posts from Server Fault or by Mr.Calm
Published on 2012-11-24T03:27:13Z Indexed on 2012/11/24 5:07 UTC
Read the original article Hit count: 478

Filed under:
|
|
|
|

Using UBUNTU and Virtal Box by Oracle, and Using this script to start nginx in Virtual Box, and placing it in Virtual box inside~/init.d

#!/bin/bash
### BEGIN INIT INFO
# Provides:          Testinit
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

#
RETVAL=0;

start() {
CurrentTime=$(date +%d/%m/%Y"-"%I:%M:%S)
./usr/local/nginx/sbin/nginx
echo "Current Time:"$CurrentTime>>/home/server/Desktop/NginxLogs.txt
echo "!Starting nginx!" >>/home/server/Desktop/NginxLogs.txt

Like this i want to write auto script (setup.sh file) and place that script in all virtual boxes inside my system, for example 8 virtual boxes and in all Virtual boxes NGINX is installed.

Now, The thing is i am facing problem when i want change something in setup.sh i have to go to each and every virtual box, or Communicate each Virtual machine through SSH from my main machine. i am thinking to write another script (ex: Update.sh),and inside that script we give one path of file which is saved and recently edited in main machine (ex: DummySetup.sh).

as soon as i run that script all the setup.sh files which are saved in each virtual machines should update the change or replace contents with DummySetup.sh's contents. Hope this is possible thing. Help would be appreciated.Thanking you

© Server Fault or respective owner

Related posts about ubuntu

Related posts about virtual-machines