Ok, now that I am getting used to some things in bash, I think I'd like to make a script to download my modified Slax from the Lug . The part that I need a little instruction on is how to script in the prompting from the lug on a u/n, and p/w. This script would be helpful as it would just d/l whatever the most current that I have done (speaking of, i think that i am do to make some changes). then in the same script I would have the automatic d/l of the newest user config for it as well. Right now I have a good idea in my head on what I need to do, except for the u/n & p/w bit. Any help wold be greatly appreciated.

how can i compare the md5 of the iso to the md5sum.txt automatically in the script

from there I want to mount the iso and copy all contents to the folder that i created. and then attempt to insert the config module into the a dir. then the user would just have to go to the dir where the make_iso.sh script is that comes with slax.

ok now if i want to mount the iso then the user would have to be run as root right cuz i would like to mount the iso and then copy all contents of the iso to the /home/user dir. ....though maybe more realistic to copy it to a new dir. in /home. what you all think

#this script should also download the corrosponding config module as#well.

clear

echo "You will have to be root to run this script!"clear#check for root functionfunction checkforroot{ROOT_UID=0if [ "$UID" -ne "$ROOT_UID" ]thenecho ""echo "**************** ERROR !! **************"echo "You must be logged in as root to run this script"echo "Please log in as root and re-run this script."echo "Program HALTED."echo ""echo "**************** ERROR !! **************"exitfi}checkforroot#this is going to make a dir. in /home to d/l and then mount the iso.cd /homemkdir USALUGcd USALUGmkdir Mount

#this script should also download the corrosponding config module as#well.

clear

echo "You will have to be root to run this script!"clear#check for root functionfunction checkforroot{ROOT_UID=0if [ "$UID" -ne "$ROOT_UID" ]thenecho ""echo "**************** ERROR !! **************"echo "You must be logged in as root to run this script"echo "Please log in as root and re-run this script."echo "Program HALTED."echo ""echo "**************** ERROR !! **************"exitfi}checkforroot#this is going to make a dir. in /home to d/l and then mount the iso.cd /homemkdir USALUGcd USALUGmkdir Mount

#this script should also download the corrosponding config module as#well.

clear

echo "You will have to be root to run this script!"clear#check for root functionfunction checkforroot{ROOT_UID=0if [ "$UID" -ne "$ROOT_UID" ]thenecho ""echo "**************** ERROR !! **************"echo "You must be logged in as root to run this script"echo "Please log in as root and re-run this script."echo "Program HALTED."echo ""echo "**************** ERROR !! **************"exitfi}checkforroot#this is going to make a dir. in /home to d/l and then mount the iso.cd /homemkdir USALUGcd USALUGmkdir Mount

#this script should also download the corrosponding config module as#well.

clear

echo "You will have to be root to run this script!"clear#check for root functionfunction checkforroot{ROOT_UID=0if [ "$UID" -ne "$ROOT_UID" ]thenecho ""echo "**************** ERROR !! **************"echo "You must be logged in as root to run this script"echo "Please log in as root and re-run this script."echo "Program HALTED."echo ""echo "**************** ERROR !! **************"exitfi}checkforroot#this is going to make a dir. in /home to d/l and then mount the iso.cd /homemkdir USALUGcd USALUGmkdir Mount

If you have the md5sum.txt file that was generated by md5sum for a set of files, you simply need to run the md5sum utility with the -c option and it'll look at the md5sum.txt file and check the file names in it against the files in the current directory and then calculate the md5 for each matching file and compare it against the value in the md5sum.txt file. *whew*

Said another way if your md5sum.txt file looks like:

Code:

abcdef0123456789 foo.txt0123456789abcdef bar.txt

when you run

Code:

md5sum -c md5sum.txt

it'll check the current directory for foo.txt and bar.txt. It will then calculate the md5 hash for each file and compare those hashes against the hashes in the md5sum.txt file associated with the corresponding file name. If a file is missing or changed, the md5sum check will fail with an exit status of 1.

That way you don't have to calculate the md5 sum of each file yourself and then parse through the md5sum.txt file to find the right hash value to compare your cacluated value against.

ok figured i'd post where i would like to see this script go. from here i'd like to put in an option for allowing the user to insert files/dir. into the /root dir. eventually this will turn into something for the live disk for usalug

Who is online

Users browsing this forum: No registered users and 19 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum