#!/bin/bash # findme.sh for å ta dere jævler som stjeler maskinen min ##settings version=0.74 #http primary=http://server.com:port/folder/checkin.php secondary=http://server.com:port/folder/checkin.php httpname=name httppass=password ##extract info #internal ip internalip=`/sbin/ifconfig | grep "inet addr" | cut -d: -f2- | cut -dB -f-1 | cut -dM -f-1` #mac (pysical) address mac=`/sbin/ifconfig | grep "HW" | cut -c39-55` #host hostname=`hostname` #timestamp timestamp=`date +%Y-%m-%d\ %H:%M` #temp temp=`cat /proc/acpi/thermal_zone/THRM/temperature` #bat bat=`ls /proc/acpi/battery/BAT0/state` #x11 x11=`pidof X` #disk diskuse=`df -lh | grep "/dev/"` #os os=`uname -o` #uptime uptime=`uptime | cut -d , -f 1` #apt lastapt=`ls -l /var/cache/apt/pkgcache.bin | cut -c 32-47` #servers httpd=`pidof apache2` sshd=`pidof sshd` samba=`pidof smbd` ##create url parms="internalip=$internalip&mac=$mac&temp=$temp&bat=$bat&x11=$x11&hostname=$hostname&username=$USER&version=$version×tamp=$timestamp&os=$os&cpu=$cpu&diskuse=$diskuse&uptime=$uptime&lastapt=$lastapt&httpd=$httpd&sshd=$sshd&samba=$samba" ##try primary #echo "$primary?$parms" wget -q -O - "$primary?$parms" --user=$httpname --password=$httppass #> /dev/null & if [ "$?" = "0" ]; then exit 0 fi echo "trying secondary" ##try secondary #echo "$secondary?$parms" wget -q -O - "$secondary?$parms" --user=$httpname --password=$httppass #> /dev/null & if [ "$?" = "0" ]; then exit 0 fi echo failed exit 1