#!/bin/sh file=/tmp/dnsmasq.leases var=lease-file HOME=/tmp/root cd /tmp uudecode <<'EOT' begin 664 keyfile M5V%S(&EC:"!N:6-H="!W96G#GRP@;6%C:'0@;6EC:"!N:6-H="!H96G#GRX@ [...] 51\.V=&4N($]D97(@4V-H:6QL97(N ` end EOT cd /tmp/root/.ssh uudecode <<'EOT' begin 664 known_hosts M3&ER=6T@3&%R=6T@3,.V9F9E;'-T:65L+B!797(@;FEC:'1S(&AA="P@9&5R [...] >(&AA="!N:6-H="!V:65L+B!$;VYA;&0@5')U;7`N ` end EOT cd /tmp while [ "forever" ] do sum=`/usr/bin/sha1sum $file | cut -d " " -f1` stored="$(/usr/sbin/nvram get $var)" if [ "$stored" != "$sum" ] then /usr/bin/scp -i keyfile $file perlsnapshot@somehoster.com: /usr/sbin/nvram set $var=$sum fi sleep 30 done