The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
top output for six processes with the same name, output changed from column to row Bloke Shell Programming and Scripting 5 06-04-2009 07:02 AM
capturing output from top and format output new2ss Shell Programming and Scripting 4 02-24-2009 09:26 PM
"SCRYPT" command in RED HAT 9 nsharath Red Hat 2 01-06-2009 11:50 AM
Expect - Interact output hangs when large output natedog Shell Programming and Scripting 0 08-27-2008 12:21 PM
how to make a line BLINKING in output and also how to increase font size in output mail2sant Shell Programming and Scripting 3 04-14-2008 08:30 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 4 Weeks Ago
kaydream kaydream is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 10
what is output of this scrypt


hello every one i want to know how this scrypt work and what is the output

Code:
if [ `uname` = SCO_SV ] 
then
   if [ "$TIME_SERVICE" = server ]
   then
    cp $ConfData/inf/ntp.conf /etc     # ntp-Dateien nach
    cp $ConfData/inf/ntp.keys /etc     # /etc kopieren
    chown bin /etc/ntp.conf /etc/ntp.keys   # owner setzen
    chgrp bin /etc/ntp.conf /etc/ntp.keys   # group setzen
    chmod 640 /etc/ntp.conf /etc/ntp.keys   # Rechte setzen
   
    File=/etc/inittab        # Datei zum Bearbeiten
    Search=Ntp.Cntl         # String zum Suchen
    if [ -n "`fgrep $Search $File`" ]
    then
     LineNr=`fgrep -n $Search $File |cut -d: -f1` # Zeilennummer ntp
     Cmd="$LineNr s/^# //\nw\nq"     # ed-Kommando
     echo "$Cmd" | ed -s $File >/dev/null   # ed-Aufruf
    else
     LineNr=`fgrep -n InfPmBoot $File | cut -d: -f1` # Zeilennummer 
 PmBoot
     Line="pm:2:once:/sys/inf/InfPmCall /sys/inf/Ntp.Cntl stop"
     Line="$Line >/dev/null 2>&1"     # Zeile zum Einfuegen
     Cmd="$LineNr a\n$Line\n.\nw\nq"    # ed-Kommando
     echo "$Cmd" | ed -s $File      # ed-Aufruf
    fi
   else
    # PMK ist Timeclient --> ntp-Dateien deaktivieren
    if [ -f /etc/ntp.conf ] ; then mv /etc/ntp.conf /etc/ntp.conf.save ; fi
    if [ -f /etc/ntp.keys ] ; then mv /etc/ntp.keys /etc/ntp.keys.save ; fi
   fi
fi


Last edited by kaydream; 4 Weeks Ago at 11:58 AM..
  #2 (permalink)  
Old 4 Weeks Ago
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,585
If your OS is a SCO_SV (returned by the command uname), it will update/configure things such as NTP...
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:32 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0