LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2010, 03:51 PM   #1
tuftystick
Member
 
Registered: Jan 2009
Location: Scotland
Distribution: CentOS 5.3
Posts: 36

Rep: Reputation: 15
Startup Script


Hello,

I'm looking to make a script that will do the following;

yum update -y
cd /home
wget http://layer1.cpanel.net/latest
sh latest
(install various scripts like ConfigServer series, ClamAV)
edit settings in files
delete any downloaded archives (clean up)
reboot/delete self

Can anyone help me with this?

Greatly Appreciated!
 
Old 05-29-2010, 04:14 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,823

Rep: Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611
Sure, what do you have already and what isn't working?
 
Old 05-29-2010, 05:55 PM   #3
tuftystick
Member
 
Registered: Jan 2009
Location: Scotland
Distribution: CentOS 5.3
Posts: 36

Original Poster
Rep: Reputation: 15
Hello,

I don't have anything. I'm looking for directions or step-by step of how to make something like that.

Thanks.
 
Old 05-29-2010, 07:42 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,823

Rep: Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611
http://www.freeos.com/guides/lsst/ or http://www.google.com/search?q=shell+scripting+tutorial

We're not here to do you work for you, but we'll help if you have specific problems as long as you demonstrate that you've tried already and are willing to learn. See also link in sig.

Looks like you have a stub already. There's your starting point for a shell script.

Code:
#!/bin/bash
yum update -y
cd /home
wget http://layer1.cpanel.net/latest
sh latest
#...
Do some research them jump right in and try it.
 
Old 05-29-2010, 08:28 PM   #5
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
It might help if you tell us what you are actually trying to accomplish. Is this meant to be a script ran once on each machine or every day? A lot of what you list there would probably be better suited to a cron job.

Running a yum update -y is probably a bad idea. Updating systems (from a non custom repo) is something that should be done live. There are tons of things that can go wrong and cripple a machine. If those things occur without someone there to watch, it can be virtually impossible to figure out what went wrong. If there is a live operator there most of these issues are easily caught (assuming the operator is not as dumb as a post).

The other odd thing that I saw is the "reboot/delete self" part. Most Linux people only reboot for a kernel change or as a solution of last resort. I would take a guess that the majority of Linux installs see at least thirty days of up time without a reboot. The delete self thing is also probably a bad idea. If the script malfunctions in some way but continues on to delete itself you are again going to find it nearly impossible to figure out what went wrong.
 
Old 05-29-2010, 11:12 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,093

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
are you VERY VERY sure you want to use the y option with yum ????

from experience this is not a good idea !!!
-- to many reasons to go into --


clamav dose not change much but running freshclam as a cron job or startup script can be done
IF you are running a mail server .If you are not running a mail server then there is really no need for that .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Startup script aloneattack Red Hat 2 03-06-2008 03:01 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Script at startup rohde Linux - Newbie 2 09-12-2004 09:32 AM
startup script c0c0deuz Linux - Newbie 3 03-29-2003 03:26 PM


All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration