NOTE: From Patrick: Please be aware that the "autorun.sh" creation commands you quoted only work with newer "HAL"-enabled" QNAP NAS models. Those same instructions will not work with older QNAP models, especially the Marvel/ARM based ones. For older units follow this guide: http://wiki.qnap.com/wiki/Running_Your_ ... at_Startup
1. Open a shh session
Copy the following code into your session:
Code: Select all
mount $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config
touch /tmp/config/autorun.sh
chmod +x /tmp/config/autorun.sh
$EDITOR /tmp/config/autorun.sh
umount /tmp/config
#done
The Vi editor will open up, hit the i key to enter INSERT mode and enter any shell commands you need.. I am copying a custom VPN setting from my VPN folder to the /etc/init.d/ folder at start up.
Code: Select all
#!/bin/sh
cp /share/CACHEDEV1_DATA/Download/VPN/vpn_openvpn_client.sh /etc/init.d/vpn_openvpn_client.sh
Press Esc on the keyboard and type :wq What you have done here is to make sure that on startup your custom vpn_openvpn_client.sh is copied into the relevant directory.