#! /bin/sh # This script generates a secret (pre-shared key) file. # Use a secure mechanism to transfer the secret file between # sender and recipient. # Only root should have permissions on the file, no other users. if [ ! -f "/usr/local/etc/rshdown/secret" ] then LENGTH=`/usr/local/bin/dk-pwgen -p -l 2` LENGTH=`expr 1460 - $LENGTH` touch "/usr/local/etc/rshdown/secret" chmod 600 "/usr/local/etc/rshdown/secret" /usr/local/bin/dk-rand -b $LENGTH > "/usr/local/etc/rshdown/secret" chmod 600 "/usr/local/etc/rshdown/secret" fi