لعرض عدد الهارد ديسك المتصل بالكمبيوتر:
#!/bin/bash
foo=$(lsblk | grep -c ^sd*)
final=$[$foo-1]
printf '%b\n' "You have currently $final Hard disks(s)"
My blog focus mainly on Computing specially administration and scripting, i focus as well on breeding lovebirds, and life and wisdom :).
#!/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
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl disable firewalld
systemctl stop firewalld
systemctl enable network
systemctl start network
yum install -y centos-release-openstack-queens
لعرض عدد الهارد ديسك المتصل بالكمبيوتر: #!/bin/bash foo=$(lsblk | grep -c ^sd*) final=$[$foo-1] printf '%b\n' "You have...