#!/sbin/sh

script_path="/tmp/arter97/script"
script_name="init.kernel.sh"
sub_scripts_path="$script_path/sub-scripts"
props_path="/tmp/aroma"

# Start making the script header -----------------------------------------------------------------

rm /data/kernel-script.log
rm /data/kernel-boot.log
cp $sub_scripts_path/header_1 $script_path/$script_name
cat $sub_scripts_path/header_2 >> $script_path/$script_name
echo "" >>$script_path/$script_name

cat $sub_scripts_path/footer >>$script_path/$script_name

# Installing generated script to system init -----------------------------------------------------

rm /system/etc/$script_name
cp $script_path/$script_name /system/etc/$script_name
chmod 755 /system/etc/$script_name
chown 0:2000 /system/etc/$script_name

rm -r /data/arter97-debug
rm -r /data/.arter97
