Richat@lemmy.ml to linuxmemes@lemmy.world · 18 hours agoWindows 10 Support Ending Soonlemmy.mlimagemessage-square87fedilinkarrow-up1565arrow-down169
arrow-up1496arrow-down1imageWindows 10 Support Ending Soonlemmy.mlRichat@lemmy.ml to linuxmemes@lemmy.world · 18 hours agomessage-square87fedilink
minus-squareMTK@lemmy.worldlinkfedilinkarrow-up8·4 hours agoYeah? No looking it up, give me a bash script for a ping scan of a subnet with a 24 bit mask.
minus-squaredream_weasel@sh.itjust.workslinkfedilinkarrow-up1·edit-232 minutes 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-up1·edit-22 hours 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-squareewenak@jlai.lulinkfedilinkarrow-up3·2 hours 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
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? 😭
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.