Monday, August 6, 2018

باش سكريبت لاضافة اعدادات الشبكة لكارت الشبكة للينكس

هذا سكريبت لأضافة اعدادات الشبكة لكارت النتورك (يستعمل السكريبت امر nmcli)

#!/bin/bash
#xp2600@gmail.com
which nmcli
if [ $? -eq 1 ];then
echo "Network manager is not installed please use "yum install NetworkManager" to install"
else
echo "NetworkManager is installed, script will start configuring your network now!"
fi

echo Please note your available network devices are: $(ip a | grep ens | grep -v inet)
echo Please enter the device name
read IFN
echo "Please Enter IPaddress followed by netmask xx.xx.xx.xx/xx"
read IP
#IP=10.0.0.50/24
echo "Please Enter gateway"
read GW
#GW=10.0.0.1
#IFN=ens257
echo "Please Enter connection name.."
read CN
nmcli con add con-name $CN type ethernet ifname $IFN \
ipv4.addresses $IP gw4 $GW






لعرض عدد الهارد ديسك المتصل بالكمبيوتر:   #!/bin/bash foo=$(lsblk | grep -c ^sd*) final=$[$foo-1] printf '%b\n' "You have...