Skip to content

Instantly share code, notes, and snippets.

View duchenpaul's full-sized avatar
:shipit:
Out sick

Chenny Du duchenpaul

:shipit:
Out sick
  • Citrix Systems, Inc.
  • Nanjing
View GitHub Profile
#!/bin/bash
TIMESTAMP=$(date +%F)
sudo cp /var/log/openwrt.log /tmp/openwrt_$TIMESTAMP.log
subject="Openwrt Log on $(date +%F)"
content="Here is the log of openwrt on `date "+%B %d %Y"`: openwrt_$TIMESTAMP.log"
python /home/pi/run/send_mail.py "$subject" "$content" -f /tmp/openwrt_*.log
sudo rm /tmp/openwrt_*.log
logger "The log: openwrt_$TIMESTAMP.log has been sent"
echo "The log of openwrt `date "+%B %d %Y"`: openwrt_$TIMESTAMP.log has been sent"
#!/bin/bash
zip -r ~/reaver_backup_`date +"%Y%m%d"`.zip /usr/local/etc/reaver;
echo 'Done zip!'
ssh -i /root/.ssh/id_rsa_3072 pi@192.168.31.179 <<'ENDSSH'
#commands to run on remote host
cd ~/;
rm reaver_backup_*.zip;
exit