Sponsored Content
Special Forums UNIX and Linux Applications [solved]Moving server...need to find all hard code IP references Post 302722381 by scasey on Friday 26th of October 2012 11:15:57 PM
Old 10-27-2012
[solved]Moving server...need to find all hard code IP references

I'm moving my web server to a different datacenter.
OS is CentOS 5.8
Apache 2.2.3
qmail
NcFTPd

Its been 12 years since I relocated a server. Lots of brain cells lost since then...:-)

I need to identify all the config files that contain the server's IP addresses. Memory has provided these:
Network - /etc/sysconfig/network-scripts/* (duh)
httpd.conf
sshd_config
NcFTPd *.cf files
resolv.conf
named.conf

Q: Does anyone see anything I'm missing and/or is there a way to search all files on the server for the old IP addresses?

TIA for any assistance.

Sean

Update: Nothing like getting some sleep...ran this from the command line and got a list of all config files that contained the ip addresses:
Code:
rm -f junk
for FILE in `grep "# config:" /etc/init.d/* | sed "s/^.*# config://"`
do 
if [ -e $FILE ] 
then
echo -n "$FILE " >> junk
grep -c 206.169 $FILE >> junk
fi
done
grep -v 0 junk

This "script"
Scans files in /etc/init.d for the names of configuration files
Checks to see if the config file exists, if yes
Output the file name
grep --count for the number of times the IP is found in the file, writing to a temp file
grep for lines that do not contain a 0 count.
Resulting in...
Code:
/etc/dovecot.conf 3
/etc/httpd/conf/httpd.conf 78
/usr/local/etc/ncftpd/general.cf 1
/usr/local/etc/ncftpd/domain.cf 1
/etc/ssh/sshd_config 2

It doesn't find config files that aren't referenced in /etc/init.d, of course, but it did catch a couple I'd missed.

Last edited by scasey; 10-27-2012 at 03:03 PM.. Reason: Solved
 

9 More Discussions You Might Find Interesting

1. Programming

how can compile cpp code containing references to java classes

hi there is example (on link given below )of such code that contains java class reference in c++ program. http://slackware.cs.utah.edu/pub/slackware/slackware-7.1/docs/Linux-HOWTO/Process-Monitor-HOWTO I am new in linux environment. and not able to compile it. when i compile it through... (1 Reply)
Discussion started by: surinder
1 Replies

2. Shell Programming and Scripting

Using grep and regular expression to find class references in a c++ file

I'm trying to math all class references in a C++ file using grep with regular expression. I'm trying to know if a specific include is usuless or not, so I have to know if there is a refence in cpp. I wrote this RE that searches for a reference from class ABCZ, but unfortunately it isn't working... (0 Replies)
Discussion started by: passerby
0 Replies

3. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

4. Shell Programming and Scripting

[SOLVED] moving multiple files? mv

HI I have a list of files that are incorrectely names and I need to move them to new name .. I tried few things that has not worked so far can you help ? I need to rename all thes eifle ( tere are over 100 ) xldn0357bap.orig.new xldn0389bap.orig.new xldn0439bap.orig.new... (12 Replies)
Discussion started by: mnassiri
12 Replies

5. HP-UX

[Solved] D380/2 hard drive

Hello everybody, I've received yesterday a very old HP server: HP9000, A3579A, D380/2 with two 180 MHz PA-RISC CPUs, 256 MB RAM. Actual firmware is 38.40. But no hard drives. I'm looking for 18 or 36 GB HD references. Is 11i v3 HP-UX working on it? Or, what is the latest version? Is 256 MB... (4 Replies)
Discussion started by: Citroen
4 Replies

6. Shell Programming and Scripting

Difficulty cleaning references to duplicated images in HTML code

Hi, I need to search and replace references to duplicated images in HTML code. There are several groups of duplicated images, which are visually the same, but with different filenames. I managed to find the duplicated files themselves, but now I need to clean the code too. I have a CSV file with... (9 Replies)
Discussion started by: mdart
9 Replies

7. Hardware

[solved] Sun Netra X1 - Adding a Second Hard Drive

As the title suggests, I'm trying to install a second drive (really want an OS mirror) on a Sun Netra X1. I've taken the spacer out, and had a go at with the drill-press so now I have a nice HDD tray. Have installed an IDE drive in the tray, plugged in the power and data cables that were... (0 Replies)
Discussion started by: Smiling Dragon
0 Replies

8. SCO

Moving hard drive and SCSI adapter to another computer

OK group, it's been 12 years since I worked with SCO. I need some direction here: SCO Openserver 5.07 I have a server with a bad motherboard. I have moved the SCSI adapter and hard drive to another computer. This new server has different hardware so I must install the chipset drivers for... (1 Reply)
Discussion started by: jscholz
1 Replies

9. Linux

Need suggestions or references to find a way to get free Linux on Windows

Hi all, I am sorry if this is a repetitive question and would be happy if I get directed to a source where I can find details about this. I have a laptop with windows 8, 8 GB RAM and 1 TB hard disk with most of the memory available for use. I am trying to find a good option to install Linux... (8 Replies)
Discussion started by: pat_pramod
8 Replies
qmail-queue(8)						      System Manager's Manual						    qmail-queue(8)

NAME
qmail-queue - queue a mail message for delivery SYNOPSIS
qmail-queue DESCRIPTION
qmail-queue reads a mail message from descriptor 0. It then reads envelope information from descriptor 1. It places the message into the outgoing queue for future delivery by qmail-send. The envelope information is an envelope sender address followed by a list of envelope recipient addresses. The sender address is preceded by the letter F and terminated by a 0 byte. Each recipient address is preceded by the letter T and terminated by a 0 byte. The list of recipient addresses is terminated by an extra 0 byte. If qmail-queue sees end-of-file before the extra 0 byte, it aborts without placing the message into the queue. Every envelope recipient address should contain a username, an @ sign, and a fully qualified domain name. qmail-queue always adds a Received line to the top of the message. Other than this, qmail-queue does not inspect the message and does not enforce any restrictions on its contents. However, the recipients probably expect to see a proper header, as described in qmail-header(5). Programs included with qmail which invoke qmail-queue will invoke the contents of $QMAILQUEUE instead, if that environment variable is set. FILESYSTEM RESTRICTIONS
qmail-queue imposes two constraints on the queue structure: each mess subdirectory must be in the same filesystem as the pid directory; and each todo subdirectory must be in the same filesystem as the intd directory. EXIT CODES
qmail-queue does not print diagnostics. It exits 0 if it has successfully queued the message. It exits between 1 and 99 if it has failed to queue the message. All qmail-queue error codes between 11 and 40 indicate permanent errors: 11 Address too long. 31 Mail server permanently refuses to send the message to any recipients. (Not used by qmail-queue, but can be used by programs offering the same interface.) All other qmail-queue error codes indicate temporary errors: 51 Out of memory. 52 Timeout. 53 Write error; e.g., disk full. 54 Unable to read the message or envelope. 55 Unable to read a configuration file. (Not used by qmail-queue.) 56 Problem making a network connection from this host. (Not used by qmail-queue.) 61 Problem with the qmail home directory. 62 Problem with the queue directory. 63 Problem with queue/pid. 64 Problem with queue/mess. 65 Problem with queue/intd. 66 Problem with queue/todo. 71 Mail server temporarily refuses to send the message to any recipients. (Not used by qmail-queue.) 72 Connection to mail server timed out. (Not used by qmail-queue.) 73 Connection to mail server rejected. (Not used by qmail-queue.) 74 Connection to mail server succeeded, but communication failed. (Not used by qmail-queue.) 81 Internal bug; e.g., segmentation fault. 91 Envelope format error. SEE ALSO
addresses(5), envelopes(5), qmail-header(5), qmail-inject(8), qmail-qmqpc(8), qmail-send(8), qmail-smtpd(8) qmail-queue(8)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy