Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Q about Dhcpc

when i exec updateip,system say :"command not found"
and i found the problem is a command miss,that is "mask" and "gateway"
where i can find it?  


This thread was automatically locked due to age.
Parents
  • These are called "variables".  They receive their value from command inside the script.  If you say a=Astaro then type cat a, the output will be Astaro ! ! !  Make sure that the files are executable.  There is an issue where the updateip has to not have blannk line in it.  Use pico or vi or something else if you have to change it.  Edit the file to reflect your environment.

    Good luck,

    Benoit
  • script file content is here:
    #!/bin/sh

    .........

    #Dynamic entries

    #######################################
    #Read from /etc/dhcpc/dhcpcd-eth1.info#
    #######################################

    ip="`cat /etc/dhcpc/dhcpcd-eth1.info | grep -i 'ipaddr' | awk '{print $1}' | sed -e 's/.*=//'`"
    mask="`cat /etc/dhcpc/dhcpcd-eth1.info | grep -i 'netmask' | awk '{print $1}' | sed -e 's/.*=//'`"
    echo eth1#External#$ip#$mask >> /etc/wfe/conf/netzkartendata

    gateway="`cat /etc/dhcpc/dhcpcd-eth1.info | grep -i 'gateway' | awk '{print $1}' | sed -e 's/.*=//'`"
    echo "Gateway: $gateway" >>/etc/wfe/conf/netzkartendata

    .......

    i can not found "mask" and "gateway" command in /sbin.
    how can i solve this issue??
    pls help me even if i am stupid.
      [:(]
  • Have you read my post ! ! !

    As I told before, these are variable, they are not files.  They are simply there to gather the result from a command.

    Here how again !
    Let say the following :

    a=1
    b=2

    c=$a+$b

    if you then do :

    cat $c

    the result will be 3

    The $ tell the system to usr the variable, not the letter by itself.

    So, in the case off dhcp,  the script temporaly store the ip address, the mask ant the gateway and use those result, stored in the variables, to put it in the files trough the echo command ! ! !

    Have it this time  [;)] 

    Benoit
  • O i C,
    thank you so much.
    So stupid i am.  [:(]
Reply Children
No Data