neurobin / JLIVECD

Live cd/dvd customization tool
https://neurobin.org/projects/softwares/unix/JLIVECD/
GNU General Public License v2.0
89 stars 24 forks source link

deletion of home directory #4

Closed danjde closed 8 years ago

danjde commented 8 years ago

Hi neurobin,

running (on Ubuntu 14.04) by JLstart "clean" script, result the deletion of the live home directory created on chroot environment, with or without "n" answer. And no echo "........edit/home cleaned!......" appears with or witout y/n

echo -e "\n...............Time is value.............\n......you have $timeout seconds each to answere the following questions.....\n......if not answered, I will take 'n' as default (be ready)...\n"
read -t $timeout -p "Want to retain edit/home directory? (y/n)?: " home
if [ "$home" != "y" ] && [ "$home" != "Y" ]; then
rm -rf edit/home/*
echo "........edit/home cleaned!......"
fi

davide

neurobin commented 8 years ago

With or Without "n" answer are the same i.e only "y" answer will make it yes, everything else (including an empty string which is returned by simply hitting Enter without putting anything as an answer) will take the answer as "no".

"no" is the default answer for all of the yes/no type questions. You need to put "y" or "Y" to make it "yes".

danjde commented 8 years ago

Ok, with "y" the home directory still not cleared. Well?

here a specific part the output from Lxde Terminal:

...............Time is value.............
......you have 120 seconds each to answere the following questions.....
......if not answered, I will take 'n' as default (be ready)...

Want to retain edit/home directory? (y/n)?: y
\n......initrd archive type: initrd.lz detected!

.....................Rebuilding initrd!....................

thanks

neurobin commented 8 years ago

Want to retain edit/home directory? (y/n)?: y This means you want to retain the home directory, i.e everything in home directory will be kept as it is. If you gave n (or nothing) as the answer it would take it as no, you don't want to retain the home directory i.e clear the home directory.

I am kinda confused though, I was under the impression that you wanted to keep the home directory intact (not cleared).

danjde commented 8 years ago

Yes, I want to keep the home directory created on chroot environment.

I think that should be more complete the "echo outp :-)ut" for both the choices. For me this was a trouble :-)

neurobin commented 8 years ago

I see, I got it now. There is no printed message like "home kept intact" and you were wondering about that. Well, home is intact if there is nothing printed about it.

I will update it though (with a message like the above one) in next release.