I'm working on a rather large script atm (it already takes 9 arguments). As such, I need to obtain both a server name and domain from the FQDN. From this, I want to both populate the hostname of the server, as well as the domain line in the /etc/resolv.conf file.
Obviously, this isn't working. I know the regex should be correct.
Here are the regex's I'm working with to obtain the hostname and domain portions:
Can anyone recommend an implementation using either sed or perl? Once I have them output to stdout I can cast them into variables, or even directly into the files. I'd appreciate any help anyone can offer. Thanks!
The script is being used immediately following automated system provisioning, so that returns (none).
Basically the script takes in the following as inputs:
<bond0ip> <bond0snm> <bond0network> <eth1ip> <eth1snm> <eth1network> <FQDN> <DGW> <nameserver>
From this it will perform a ton of different actions. <FQDN> had originally just been hostname, however there is now a vendor requirement that we include a domain line in our resolv.conf file, so I have to make it into a FQDN and extract both from the one item so I can write them into the appropriate config files. Hope that clears stuff up a bit.
The easiest way would be if I could put in host name and domain separately, but as far as I know you can't use more than 9 arguments in a shell script (at least I've always had issues since $10 is viewed as $1 plus a 0).
The easiest way would be if I could put in host name and domain separately, but as far as I know you can't use more than 9 arguments in a shell script (at least I've always had issues since $10 is viewed as $1 plus a 0).
you probably can't get much help without posting your script or at least relevant portions of it... nobody really wants to guess how you're trying to do everthing.
the way you're doing your hostname and domain seems a lot more complicated then it needs to be.
if, for example, you input your FQDN and assign it to a varialbe called FQDN
a few approachs come to mind, for getting variables input for your script.
1. you could use read statements to get all your paramaters, this would let you have as many input varbs as you would ever need.
2. you could put all your paramaters into a seperate file, then simply source that.
you probably can't get much help without posting your script or at least relevant portions of it... nobody really wants to guess how you're trying to do everthing.
the way you're doing your hostname and domain seems a lot more complicated then it needs to be.
if, for example, you input your FQDN and assign it to a varialbe called FQDN
a few approachs come to mind, for getting variables input for your script.
1. you could use read statements to get all your paramaters, this would let you have as many input varbs as you would ever need.
2. you could put all your paramaters into a seperate file, then simply source that.
Hey All,
We have defined abc.this.that in:
/etc/named.conf
and corresponding files but after the change that we verified through dig -x this.that ptr all is resolving correctly. However in the /var/log/named/named.log file we still see entries for:
4-May-2015 12:15:30.390 queries:... (6 Replies)
I have a RHEL server where I want to create a mail server so I can send myself alerts whenever X process have problems.
Disclaimer:
Im a programmer thats been forced to do IT. So I'm trying my best here.
The problem:
While configuring Postfix it asks for $myhostname which apparently must be... (2 Replies)
Hi,
I'm having issues with sendmail when I try to send host to host mail. I've had to change the "my official domain name" line to mycompany.com to get the mails through the external spam filter, when a mail was sent with hostname.mycompany.com it was blocked. I had to change the Dj macro... (0 Replies)
Hi All,
So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says:
It should say:
What gives? And how do... (4 Replies)
When I connect to any IRC server, it's usually my ISP IP address/hostname. I own a domain, but I'm not using it for anything (no web hosting service or server). Is it possible for me to use my domain as my IRC hostname instead of my regular ISP hostname? (0 Replies)
Dear Expert,
i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant.
... (2 Replies)
Hello,
I am new to Solaris.
I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
I have a need to create a connection between an erlang node and my C program.
the name of an erlang node looks something like monitor@host1.ipc.co.za.
The piece of code I have to construct a node name looks like this:
char *hostname, *domainname, *nodename = "monitor", *thisfullnodename;
... (1 Reply)