Ok so i deleted the event file that was made under the /boot/custom/bin location and ran the below 2 commands
chmod a+x /usr/local/emhttp/webGui/event/starting/fetch_key
-rwx--x--x 1 root root 255 Aug 7 16:23 fetch_key*
chmod a+x /usr/local/emhttp/webGui/event/started/delete_key
-rwx--x--x 1 root root 34 Aug 7 16:23 delete_key*
Even tried chmod 777 for both files
chmod 777 /usr/local/emhttp/webGui/event/started/delete_key
-rwxrwxrwx 1 root root 34 Aug 7 16:23 /usr/local/emhttp/webGui/event/started/delete_key*
The 2 files permission look ok now and then i ran this
tar -czf /boot/custom/bin/events -C /usr/local/ emhttp/webGui/event/starting/fetch_key emhttp/webGui/event/started/delete_key emhttp/webGui/event/stopped/fetch_key
and updated my go with this
#!/bin/bash
# Auto Unlock Array
tar -xzf /boot/custom/bin/events -C /usr/local/
# Start the Management Utility
/usr/local/sbin/emhttp &
Rebooted and still did not start, nor did the keyfile come across to /root/ - but if i ran the commans in the fetch file manual, the file comes down ok.
Any other thoughts as to what i am doing wrong here?
Aug 7 19:07:48 unRaid emhttpd: shcmd (21): udevadm settle
Aug 7 19:07:49 unRaid emhttpd: Opening encrypted volumes...
Aug 7 19:07:49 unRaid emhttpd: Missing encryption key
UPDATE.....
After hours and hours the issue was that my fetch_key file had spurious CR characters and to fix that I ran the following:
sed -i -e 's/\r$//' /boot/custom/bin/fetch_key
This got rid of the CR chars (i had used Notepad++) i guess i should have used vi..