Richat@lemmy.ml to linuxmemes@lemmy.world · 3 days agoWindows 10 Support Ending Soonlemmy.mlimagemessage-square147fedilinkarrow-up1795arrow-down191
arrow-up1704arrow-down1imageWindows 10 Support Ending Soonlemmy.mlRichat@lemmy.ml to linuxmemes@lemmy.world · 3 days agomessage-square147fedilink
minus-squareMTK@lemmy.worldlinkfedilinkarrow-up13·2 days agoYeah? No looking it up, give me a bash script for a ping scan of a subnet with a 24 bit mask.
minus-squareihawk@programming.devlinkfedilinkarrow-up2·edit-21 day ago#!/bin/bash for i in 0…254; do ping -c 4 10.0.0.$i &; done wait Throwing that many background tasks at once is a little risky, but awesome
minus-squaredream_weasel@sh.itjust.workslinkfedilinkarrow-up6·edit-22 days ago#!/bin/bash ping 255.255.255.0 > checker & sleep 5 kill “$!” grep unreachable checker || echo ‘255.255.255.0’ ping 255.255.255.1 > checker & sleep 5 kill “$!” grep unreachable checker || echo ‘255.255.255.1’ ping 255.255.255.2 > checker & sleep 5 kill “$!” grep unreachable checker || echo ‘255.255.255.2’ … Did I do it coach? 😭
minus-squaregens@programming.devlinkfedilinkarrow-up2·edit-22 days agonmap -sn x.x.0.0/24 I think, was a while. Pure coincidence how I know. Edit: no, it’s one less x because 16 is the middle.
minus-squarex00z@lemmy.worldlinkfedilinkEnglisharrow-up3arrow-down1·2 days agoThat’s not a bash script silly.
minus-squareewenak@jlai.lulinkfedilinkarrow-up10·2 days agoJust add #!/bin/bash before the code from above.
Yeah? No looking it up, give me a bash script for a ping scan of a subnet with a 24 bit mask.
#!/bin/bash
for i in 0…254; do ping -c 4 10.0.0.$i &; done
wait
Throwing that many background tasks at once is a little risky, but awesome
#!/bin/bash
ping 255.255.255.0 > checker &
sleep 5
kill “$!”
grep unreachable checker || echo ‘255.255.255.0’
ping 255.255.255.1 > checker &
sleep 5
kill “$!”
grep unreachable checker || echo ‘255.255.255.1’
ping 255.255.255.2 > checker &
sleep 5
kill “$!”
grep unreachable checker || echo ‘255.255.255.2’
…
Did I do it coach? 😭
You get an A for effort!
nmap -sn x.x.0.0/24 I think, was a while. Pure coincidence how I know.
Edit: no, it’s one less x because 16 is the middle.
Close!
That’s not a bash script silly.
Just add
#!/bin/bash
before the code from above.Dang.