Hi pigpen,
Tks for your response and URL
I re-organize my question as follows in anticipation to make it clearer;
I have following command line embedded on a desktop icon and a script. They work for me.
Command line
Code:
xterm -hold -T "CDMaker by satimis" -e "su -c /path/to/cdmake"
Script
Code:
#!/bin/bash
# Set ISO filename...
user=$(whoami)
now=$(date +%Y.%m.%d.%R)
ISO_File="/home/satimis/To_burn/image_${user}_${now}.iso"
dir1="/home/satimis/Document/"
dir2="/home/satimis/Photo/"
# Loop to get directories...
echo "Enter directories to burn. Leave blank to end list"
entry="empty"
list=""
count=0
until [ -z $entry ]; do
echo -n "Enter a directory: "
read entry
if [ $entry != "" ]; then
list="$list $1$entry"
fi
done
# Create ISO file...
mkisofs -R -o "$ISO_File" -l -graft-points -hide-rr-moved \
/Document/=$dir1 \
/Photo/=$dir2 \
$list
# Burn ISO file to disc
cdrecord dev=ATA:0,0,0 -v -eject “$ISO_File”
# Remove ISO file
rm “$ISO_File”
Steps taken as follow;
1)Clicking the icon starting xterm
2)Enter password to login as root
3)Enter further directories, if any, with corresponding path in the form of “/Dir_AAA/=/path/to/Dir_AAA, etc. (cdrecord format). (If no further entry just hit <Enter> to continue)
Remark:
dir1="/home/satimis/Document/"
dir2="/home/satimis/Photo/"
are permanently added.
Then the script will take care of the rest and a CD is burnt finally.
Now I need to re-edit;
1)The command line as
Code:
xterm -hold -T "CDMaker by satimis" -e /path/to/cdmake"
Let the script to handle login as root to execute commands on background.
2)Re-edit the script to perform
a)
Login as root after ISO_File created because USER is not allowed to burn CD.
(I don't want to add USER to the wheel using this route. Hoping to learn more on script)
b)
Re-edit the script to perform following steps.
b-1)
The script is evoked by the revised command line
b-2)
Before
dir1="/home/satimis/Document/"
dir2="/home/satimis/Photo/"
are added, confirmation is now required. It will pop up for entry of “yes” or “no”. If “yes” they will be added. If “no” they will not be added. The script will continue to next command asking for adding of further directory/directories with corresponding path.
Remark:
dir1="/home/satimis/Document/"
dir2="/home/satimis/Photo/"
are still added on the script
b-3)
After an ISO_file created, it will continue to login as root asking for input of root password.
b-4)
After a CD burnt, xterm will close. I'll remove the option “-hold” later to get it done.
Please advise. I'm now getting into some confusing.
TIA
B.R.
Satimis