New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Scripts Detect Network Interface Centos
Hi,
This is my scripts detect network interface in centos (eth vs venet).
#!/bin/sh
RED='\033[01;31m'
GREEN='\033[01;32m'
RESET='\033[0m'
clear
if [ "/sbin/ifconfig | grep venet" ];then
echo -e "[ $GREEN venet $RESET ]"
else
echo -e "[ $RED eth0 $RESET ]"
fi
when i test script it have error
: command not foundne 5: clear
: command not foundne 6:
testifconfig.sh: line 12: syntax error: unexpected end of file
Someone can fix it for me?
Regards,
Comments
Are you creating testifconfig.sh on a Windows machine and then uploading it to your CentOS machine?
If that's the case the problem might be end-of-line markers. Use dos2unix to convert the '\r\n's time '\n's.
For the "clear" problem, make sure you have the program in your path.
See ya...
d.c.
It working now. Thank you. Mod can closed topic.