.
Howdy,
What output do you receive if you run these two commands:
/sbin/ifconfig eth0|grep 'inet addr'|cut -d: -f2|cut -d" " -f1
/sbin/ifconfig
However, you may be seeing a bug in the script. What you could always do is edit line 214 of the install.sh script, where it begins with:
primaryaddr=
And you could make that line read as follows:
primaryaddr=“MY_INTERFACE”
And then re-run the install script, and see if that works for you.
-Eric
Hey I’ve got the same problem !
Here’s the solution :
BAD /sbin/ifconfig eth0|grep ‘inet addr’|cut -d: -f2|cut -d" " -f1
GOOD /sbin/ifconfig eth0|grep ‘inet adr’|cut -d: -f2|cut -d" " -f1
As you can see ‘inet addr’ have to be ‘inet adr’
LANG environment variables strike again ! ?
Bye.
LaBanane
Right now I installed Virtualmin GPL on my VPS with fresh Centos 5 x86 and got the same error:
INFO - Unable to determine IP address of primary interface.
Please enter the name of your primary network interface:
eth0
Option “-d” is unknown, try “ip -help”.
./install.sh: line 251: [: addr:XXX.XXX.XXX.XXX: unary operator expected
where XXX.XXX.XXX.XXX is my correct IP address. In the install.sh script I see this:
detect_ip () {
#primaryaddr=`/sbin/ifconfig eth0|grep 'inet addr'|cut -d: -f2|cut -d" " -f1`
primaryaddr=`/sbin/ip -f inet -o -d addr show dev \`/sbin/ip ro ls | grep default | awk '{print $5}'\` | head -1 | awk '{print $4}' | cut -d"/" -f1`
I tested both command in the shell, and first one (commented) show my correct IP, while second gave the same error ‘Option “-d” is unknown’. So I uncommented 1st command, commented 2nd and could successfully install Virtualmin.
This post is for those who will get here through the search or google, like me.