Sponsored Content
Top Forums Shell Programming and Scripting Shell Script to check dhcp conf file Post 302949556 by Crazy_Nix on Monday 13th of July 2015 05:08:25 AM
Old 07-13-2015
Dear Rudi,

Thanks, a lot for all the help. I appended the script and got the desired result

Code:
#!/bin/bash


echo -e "Please enter the Circuit ID : \c"
read CID
[ $(grep -c "$CID" dhcp.conf) != 0 ] && echo " the Circuit ID : $CID is duplicate " || echo " the Circuit ID : $CID  is unique. "
echo -e "Please enter Subnet mask: \c"
read SB
if [ "$SB" != 255.255.224.0 ]
then
echo " The Subnet Mask is not /19 as per requirement. Please correct it "
else
echo " The Subnet Mask is /19 which is required "
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete dhcp.conf entry using sed

I am trying to use sed to remove entries from my dhcpd.conf file. The form of the file is: host foo { option 1 option 2 } host bar { option 1 option 2 } I was trying to use a label like: sed -e :a -e "s/^host bar {*//g;/{/N;//ba" /etc/dhcpd.conf... (2 Replies)
Discussion started by: tizatron
2 Replies

2. Solaris

Solaris Install over WAN(where to keep wanboot.conf file for DHCP client)

I am trying to configure my jumpstart server to install Solaris 10 on a T1000 machine(target) over WAN. I do not know the IP address of the client, i wish the client to get the IP address from DHCP. how do i configure my /etc/netboot hierarchy. One option would be to keep the wanboot.conf in... (1 Reply)
Discussion started by: hemalsid
1 Replies

3. Shell Programming and Scripting

File System Check using shell script !!!

Hi Guys I m posing this new thread as I didnt get satisfactory result after running search here. My requirement is very simple (using shell script) I need to findout what all file systems are mounted -> Then I need check the health of that file system - by disk usage & by doing a simple... (8 Replies)
Discussion started by: csaha
8 Replies

4. Shell Programming and Scripting

need to check the file using ftp in a shell script

i need to write a shell script.. connecting to another server using ftp and check whether the file ter.txt is exists there or not. i have written scirpt partially,as i new to Unix. ftp -inv $FTPHOST > $TEMPFILE1 2> $TEMPFILE1 << EOF user $FTPUSER $FTPPW binary prompt ${CD} ls *.txt... (11 Replies)
Discussion started by: KiranKumarKarre
11 Replies

5. Shell Programming and Scripting

Need to check for empty file in C shell script

I am running a C shell script. I have an output file from a previous step and I need to run "something" in the next step to check if the file is empty. If the file is empty, then the job script should finish EOJ. If the file is not empty then the job script should abend. Please help Thanks. (4 Replies)
Discussion started by: jclanc8
4 Replies

6. Shell Programming and Scripting

How to check file name format using shell script?

Hi, I am writting a script, which accepts input file as parameter. Input file name is aa_bb_cc_dd_ee.<ext> I need to check that input file name should be of 5 fileds. Please help me out. :confused: (7 Replies)
Discussion started by: Poonamol
7 Replies

7. Shell Programming and Scripting

How to check the duplicancy of file using shell script?

Hi all, i am getting the file through sftp from a location in the name of 20141201_file.txt (iam getting the file on daily basis with date appended at the beginning) so before going to my actual process ,i want to check whether today files and yesterday file are same or not(which i used to... (3 Replies)
Discussion started by: hemanthsaikumar
3 Replies

8. UNIX for Dummies Questions & Answers

Need shell script to check file

Hi Experts, I am not good in writing script. Just stared.I am looking for shell script to check following parameters. 1) Number of files on remote Linux SUSE server.- Any directory and sub directory. 2) I should define number of files in script. Files should be variable. 3) Age of... (2 Replies)
Discussion started by: ApmPerfMonitor
2 Replies

9. UNIX for Beginners Questions & Answers

Changes in dhcpd.conf do not make a difference in DHCP service behaviour

Hi Experts, Our DHCP server currently answers the DHCP Discover requests from ServerX. In our dhcpd.conf file there are parameters defined for ServerX. Now we introduced some additional Servers into the network and want them to get service from the same DHCP server. Similar configuration... (13 Replies)
Discussion started by: ekorgur
13 Replies

10. UNIX for Beginners Questions & Answers

Shell Script to check a file

I'm required to write a simple shell script that when it runs it writes the output which is a simple barcode to a tmp flat file which I can do the bit I'm struggling with... The next time it runs I need to check the tmp output file to see if that barcode is in the output file and if it is send... (5 Replies)
Discussion started by: worky
5 Replies
WICD-WIRED-SETTINGS.CONF(5)					File Formats Manual				       WICD-WIRED-SETTINGS.CONF(5)

NAME
wicd-wired-settings.conf - controls Wicd's wired network settings DESCRIPTION
This file contains configuration information for wired interfaces in Wicd. This file is located at /etc/wicd/wired-settings.conf SETTINGS
default = <0|1> This option decides whether to use this profile as the default. 0 = do not use this profile as default. 1 = use this profile as default. beforescript = <None|arbitrary_script> This defines a script to run before Wicd brings up the connection. The script should be a Bourne-compatible script and should be executable. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is only writable by root. afterscript = <None|arbitrary_script> This defines a script to run after Wicd brings up the connection. The script should be a Bourne-compatible script and should be executable. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is only writable by root. predisconnectscript = <None|arbitrary_script> This defines a script to run before Wicd disconnects the interface. The script should be a Bourne-compatible script and should be executable. postdisconnectscript = <None|arbitrary_script> This defines a script to run after Wicd disconnects the interface. The script should be a Bourne-compatible script and should be executable. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is only writable by root. ip = <None|ip_address> Use this option if you have a static ip address for your system. netmask = <None|networkmask> This setting is only appropriate if a static ip address is configured above. broadcast = <None|broadcast_address> This setting is only appropriate if a static ip address is configured above. gateway = <None|gateway_address> This setting is only appropriate if a static ip address is configured above. use_static_dns = <True|False> True = use static DNS servers instead of accepting what the dhcp server supplies. use_global_dns = <True|False> True = use the global DNS servers provided in wicd-manager-settings.conf(5). This option is only appropriate if "use_static_dns = True" dns1 = <None|ip_address> Static DNS address if "use_static_dns = True" and "use_global_dns = False" dns2 = <None|ip_address> Static DNS address if "use_static_dns = True" and "use_global_dns = False" dns3 = <None|ip_address> Static DNS address if "use_static_dns = True" and "use_global_dns = False" SEE ALSO
wicd(8), wicd-curses(8), wicd-manager-settings.conf(5), wicd-wireless-settings.conf(5). wicd-1.7.2.4 WICD-WIRED-SETTINGS.CONF(5)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy