2011-03-03 17:29:45 +01:00
|
|
|
automated_script ()
|
|
|
|
{
|
|
|
|
script="$(kernel_cmdline script)"
|
2011-04-12 03:44:30 +02:00
|
|
|
if [[ -n "$script" ]]; then
|
2011-03-03 17:29:45 +01:00
|
|
|
stat_busy "Configuring $script"
|
2011-04-12 03:44:30 +02:00
|
|
|
if [[ "$script" =~ "^http://" || "$script" =~ "^ftp://" ]]; then
|
2011-03-03 17:29:45 +01:00
|
|
|
wget "$script" -q -O /tmp/startup_script >/dev/null
|
|
|
|
rt=$?
|
|
|
|
else
|
2011-04-12 03:44:30 +02:00
|
|
|
cp "$script" /tmp/startup_script
|
2011-03-03 17:29:45 +01:00
|
|
|
rt=$?
|
|
|
|
fi
|
2011-04-12 03:44:30 +02:00
|
|
|
if [ $rt -eq 0 ]; then
|
2011-03-03 17:29:45 +01:00
|
|
|
chmod +x /tmp/startup_script
|
2011-04-12 03:44:30 +02:00
|
|
|
echo -e '\nif [ $(tty) = "/dev/tty1" ]; then\n /tmp/startup_script\nfi\n' >> /root/.bash_profile
|
2011-03-03 17:29:45 +01:00
|
|
|
stat_done
|
|
|
|
else
|
|
|
|
stat_fail
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
add_hook multi_end automated_script
|