2011-06-18 23:38:58 +02:00
|
|
|
automated_script ()
|
|
|
|
{
|
|
|
|
script="$(kernel_cmdline script)"
|
2011-10-12 19:40:19 +02:00
|
|
|
if [[ -n "${script}" ]]; then
|
2011-06-18 23:38:58 +02:00
|
|
|
stat_busy "Configuring $script"
|
2011-10-12 19:40:19 +02:00
|
|
|
if [[ "${script}" =~ ^http:// || "${script}" =~ ^ftp:// ]]; then
|
|
|
|
wget "${script}" -q -O /tmp/startup_script >/dev/null
|
2011-06-18 23:38:58 +02:00
|
|
|
rt=$?
|
|
|
|
else
|
2011-10-12 19:40:19 +02:00
|
|
|
cp "${script}" /tmp/startup_script
|
2011-06-18 23:38:58 +02:00
|
|
|
rt=$?
|
|
|
|
fi
|
2011-10-12 19:40:19 +02:00
|
|
|
if [ ${rt} -eq 0 ]; then
|
2011-06-18 23:38:58 +02:00
|
|
|
chmod +x /tmp/startup_script
|
|
|
|
echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile
|
|
|
|
stat_done
|
|
|
|
else
|
|
|
|
stat_fail
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
add_hook multi_end automated_script
|