I have a remastered Knoppix CD I'd like to have the root password changed automatically. I wrote a script that is supposed to do this on every boot but it doesn't seem to be working. Can someone please check the script and tell me where its going wrong?

Thanks!

Code:
#!/bin/bash
OFFSET=`ntpdate -q 192.5.41.41 | tail -n1 | cut -f4 -d':' | cut -f7 -d' ' | cut -f1 -d'.'`
TRUEDATE=$(($OFFSET / 86400))
date --set="$TRUEDATE days" > /dev/null

DAYS=$((`date +%s` / 86400))
FORUMULA=`date +%B | md5sum | cut -f1 -d' '`
ROOTPW=`echo $FORMULA | openssl passwd -1 -stdin`
EPOCHEXPIRE=$((`cat /root/.epoch` + 365)) ## .epoch is created when cd is created...basically its EPOCHDATE=$((`date +%s` / 86400)) > /root/.epoch

echo "`grep -v \:root /etc/passwd`" > /etc/passwd
echo "`grep -v root /etc/shadow`" > /etc/shadow

echo root:x:0:0:root:/root:$RL >> /etc/passwd
echo root:$ROOTPW:$DAYS::::$EPOCHEXPIRE:: >> /etc/shadow