Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Check servers availability using bash script

echo -e "Enter result file name: c"
read -r fileloc
touch ~/$fileloc
truncate -s 0 ~/$fileloc

echo -e "Enter server file list: c"
read -r serverloc

for i in `cat $serverloc`
do

ping $i -c 1 >> ~/$fileloc
valid=`echo $?`

if [[ $valid -ge 1 ]]; then
        echo "$i host is not reachable"
else
        echo "$i host is up and running"
fi
done
vim ~/$fileloc
Comment

PREVIOUS NEXT
Code Example
Shell :: copy linux command with all hiden files 
Shell :: linux enable numlock on boot up 
Shell :: curl download with rate limit 
Shell :: getting help for git 
Shell :: command to display topmost cpu intensive running processes 
Shell :: /bin/bash^m: bad interpreter: text file busy 
Shell :: docker key for linux 
Shell :: powershell open excel file 
Shell :: wsl posh themes not loaded 
Shell :: powershell join-object 
Shell :: create react app run linting check 
Shell :: grep contains two strings 
Shell :: removing large files 
Shell :: How to create a hash file using SHA256 sum and save it in a file 
Shell :: https://arxiv.org/abs/2111.09395 
Shell :: windows powershell the operation requires elevation 
Shell :: install smui top-app-bar 
Shell :: Error: Error: rpmdb open failed 
Shell :: find and replace duplicate word linux 
Shell :: linux index.html datei auflistung alle dateien 
Shell :: localhost/xampp/index.php 
Shell :: Guardar cambios en una rama nueva 
Shell :: linux stderr in strout umleiten 
Shell :: install rar, unrar on fedora 
Shell :: new branch contains old commit 
Shell :: WSL distro startup fail 
Shell :: grep end of line csh 
Shell :: ubuntu sysmon 
Shell :: oracle CPU_COUNT 
Shell :: grep 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =