Hi all,
I've taken to using UMR for some admin tasks at work. ive figured out how to use UCK to customise it and get my scripts in it that I need.
i want to retain the headless environment (dont need a gui) and have customised as such.
The problem im having is with the following script.
Code:
#!/bin/sh
clear
set +v
listdisk=`fdisk -l /dev/sda |grep /dev/ |grep -v Disk |cut -d " " -f1`
for i in $listdisk; do
echo "working on partition: " $i
val=`echo $i |grep sda |cut -d "/" -f3`
mount /dev/$val /media/$val
if [ ! -f /media/$val/boot.ini ];
then
echo "file not found"
else
echo "file found"
rm /media/$val/boot.ini
cp /media/$val/Temp/boot.ini.pe /media/$val/boot.ini
break
fi
wait
done
I need this script to run automatically, but I also need feedback from it to let me know it has functioned correctly. Ive tried to use cron, init.d, /etc/profile, /etc/profile.d/ and a few other things. There are two main problems, either I get no feedback, or it doesnt appear to be authenticated and can't mount. When I run the script manually it works perfectly.
Basically what I need is this. once my custom UMR build logs in (which it does automatically as user ubuntu) and at the $ prompt, I need the script to execute, and display the "echo" sections.
Any thoughts?
Bookmarks