Bash WakeOnLan with Nmap - Raspberry Pi Forums
hi guys, terrible @ programming can please me script? ultimate goal script make sure nmap , wakeonlan installed, send magic packet mac address , ran nmap pipe ip of mac address variable , ping confirm. got far: code: select all #!/bin/bash ip=sudo nmap -sp 192.168.2.0/24 | awk '/00:24:8c:fd:f9:3e/{print $3;}' | sort clear # first check if pv package installed, if not, install first packagestatus=`dpkg -s wakeonlan | grep status`; if [[ $packagestatus == s* ]] echo "package 'wakeonlan' installed." else echo "package 'wakeonlan' not installed." echo "installing package 'wakeonlan'. please wait..." apt-get -y install wakeonlan fi packagestatus=`dpkg -s nmap | grep status`; if [[ $packagestatus == s* ]] echo "package 'nmap' installed." else echo "package 'nmap' not installed." echo "installing package 'nmap'. pleas...