manta=https://us-east.manta.joyent.com
path=/Joyent_Dev/public/SmartOS/hotpatches/OS-5123

curl -sk $manta/$path/dthp > /var/tmp/dthp
curl -sk $manta/$path/dthp.conf > /var/tmp/dthp.conf

sum=`cksum /var/tmp/dthp`

if [[ "$sum" != "4163759540 192808 /var/tmp/dthp" ]]; then
        echo "dthp: checksum mismatch: $sum"
        exit 1
fi

sum=`cksum /var/tmp/dthp.conf`

if [[ "$sum" != "3368325169 40 /var/tmp/dthp.conf" ]]; then
        echo "dthp.conf: checksum mismatch: $sum"
        exit 1
fi

echo "Laying down dthp..."

sdc-oneachnode -a -g /var/tmp/dthp -d /kernel/drv/amd64

echo "Laying down dthp.conf..."

sdc-oneachnode -a -g /var/tmp/dthp.conf -d /kernel/drv

echo "Done. \"add_drv dthp\" when ready"

