View Single Post
Posts: 198 | Thanked: 130 times | Joined on Sep 2012 @ Pakistan
#3
I have this script of coderus to resign refhashlist:

Code:
#!/bin/sh
#refhashlist patcher
cp /var/lib/aegis/refhashlist /var/lib/aegis/refhashlist.backup
pathname=$1
if [ "$pathname" == "" ]; then exit 1; fi

line=$(grep "${pathname}" /var/lib/aegis/refhashlist)
if [ "$line" == "" ]; then exit 2;
else
        #oldsha1=$(for ii in $(sha1sum /${pathname}); do echo $ii; break; done) #real file sha1
        #oldsha1=$(i=0; for ii in $line; do i=$((i+1)); if [ $i -eq 6 ]; then echo $ii; break; fi; done;) #sha1 parsed from line, not real sha1
        oldsha1=$(echo ${line} | sed -re "s/.*([a-f0-9]{40}).*/\1/") #faster sha1 extraction using regexp
        newsha1=$(for ii in $(sha1sum "/${pathname}"); do echo $ii; break; done)
        newline=$(echo ${line} | sed -e "s/${oldsha1}/${newsha1}/")
        sed -i -e "s@${line}@${newline}@" /var/lib/aegis/refhashlist

        accli -c tcb-sign -F /var/lib/aegis/refhashlist < /var/lib/aegis/refhashlist
fi
stored it in MyDocs/Temp1 folder.

but when I execute it, it gives the following error:

Code:
home/user/MyDocs/Temp1 # /bin/sh refhashlist.s
h etc/dbus-1/system.d/dnsmasq.conf
refhashlist.sh: line 18: syntax error: unexpected end of file (expecting "fi")
I do have Inception Installed. any help?
__________________
N9 - 16 GB Black Reborn

Tutorial - OpenVPN for N9

Last edited by khan.orak; 2013-04-08 at 19:11.