Many thanks for your replies.
But if I type this "network.sh" in the terminal in backtrack 3 final I can see the script output, if I do this in BT4 it resuts in a error "bash: network.sh : command not found".
network.sh convert with notepad++
Code:
#!/bin/bash
# Backtrack Network Manager v 1.1 beta
#Based upon M1r4g3 original work
#Updated & modified by M1ck3y
#... Enjoy ;)
# intro
intro="\n
-------------------------------------------\n
~~~~~~~~~ BACKTRACK NETWORK MANAGER ~~~~~~~\n
-------------------------------------------\n
-------~ Semi automatic management ~-------\n
-------~ Of the network card eth0 ~--------\n
-----~ Developed for Backtrack 3 Final ~---\n
-------------------------------------------\n
---- Brought to you by M1ck3y & M1r4g3 ----\n
------------- www.crack-wpa.fr ------------\n
-------------------------------------------\n"
# Choix d'Action
clear
echo -e $intro
echo "--> Please enter your choice:"
echo
echo "--> 1 Eth0 informations"
echo "--> 2 Set eth0 up"
echo "--> 3 Set eth0 down"
echo "--> 4 Set your ip address, netmask and getaway"
echo "--> 5 Set the DNS server"
echo "--> 6 Activate DHCP on eth0"
echo "--> 7 Network test (ping)"
echo
echo "--> Your choice:"
read choix
case $choix in
#On affiche ifconfig eth0
1)
clear
echo -e $intro
echo "--> Eth0 informations:"
sleep 3
clear
echo -e $intro
ifconfig eth0
sleep 6
$0;;
#on active eth0
2)
clear
echo -e $intro
echo "--> Bringing eth0 up..."
sleep 3
clear
echo -e $intro
ifconfig eth0 up
clear
echo -e $intro
echo "--> eth0 up"
sleep 3
$0;;
#On d�sactive eth0
3)
clear
echo -e $intro
echo "--> Bringing eth0 down..."
sleep 3
clear
echo -e $intro
ifconfig eth0 down
clear
echo -e $intro
echo "--> eth0 down"
sleep 3
$0;;
#On configure l'ip, le masque de sous r�seau et la passerelle
4)
clear
echo -e $intro
echo "--> Please enter the following informations:"
echo
echo "--> (IP: static ip address of your network card eth0)"
echo "--> (NETMASK: the netmask)"
echo "--> (GETAWAY: the getaway)"
echo
echo "--> IP NETMASK GETAWAY:"
read ip netmask getaway
clear
echo -e $intro
echo "--> Setting new IP configuration..."
echo "--> IP address: $ip"
echo "--> Netmask: $netmask"
echo "--> Getaway: $getaway"
sleep 4
clear
ifconfig eth0 $ip netmask $netmask
route add default gw $getaway eth0
echo -e $intro
echo "--> Network settings saved."
sleep 3
$0;;
#On configure le serveur DNS
5)
clear
echo -e $intro
echo "--> Please enter the following information:"
echo
echo "--> (DNS: ip address of the DNS server)"
echo
echo "--> DNS:"
read dns
clear
echo -e $intro
echo "--> Setting new DNS configuration..."
echo "--> DNS server: $dns"
sleep 3
clear
"echo" nameserver $dns > /etc/resolv.conf
echo -e $intro
echo "--> Network settings saved."
sleep 3
$0;;
#On active le dhcp
6)
clear
echo -e $intro
echo "--> Activating dhcp on eth0..."
sleep 2
clear
echo -e $intro
dhcpcd eth0
clear
echo -e $intro
echo "--> DHCP successfully activated"
sleep 3
$0;;
#On teste le r�seau avec un ping
7)
clear
echo -e $intro
echo "--> Please enter the following information:"
echo
echo "--> (ADDRESS: address where you want to launch"
echo "--> a ping to test the network. It can be an"
echo "--> IP address or a domain name)"
echo
echo "--> ADDRESS:"
read ipping
clear
echo -e $intro
echo "--> Ping $ipping ..."
ping $ipping -c 5
sleep 3
clear
echo -e $intro
echo "--> End of the network test."
sleep 4
$0;;
esac