Commit e660cee0 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Better usability for saving configuration

parent e780ddba
......@@ -62,18 +62,33 @@ function configure {
echo "Mounted external partitions list:"
for mnt in "${mountpoint}"/* ; do
echo " * $mnt"
place_suggestion="$mnt"
done
else
echo "No external device partition mounted on ${mountpoint}."
place_suggestion="/usr/local/"
fi
read -e -p "A folder called 're6stconf' will be generated in order to backup the freshly created configuration. Where should it be created [$place_suggestion] (use tabulation for autocompletion)? " place
if [ "$place" = "" ] ; then
place="$place_suggestion"
fi
read -e -p "A folder called 're6stconf' will be generated in order to backup the freshly created configuration. Where should it be created (use tabulation for autocompletion)? " place
place+="/re6stconf"
echo "configuration will be saved in $place"
install -d "${place}"
for file in "${configdir}"/* ; do
install "${file}" "${place}"
done
if [ -w "$place" ] ; then
place+="/re6stconf"
echo "configuration will be saved in $place"
install -d "${place}"
for file in "${configdir}"/* ; do
install "${file}" "${place}"
done
else
echo
echo "#####################################################################################"
echo "WARNING: $place is not writable, the configuration won't be save. If you want to save it later, copy the directory ~/.re6stconf yourself."
echo "#####################################################################################"
echo
fi
else
echo -e "Configuration will be placed in ${configdir},\e[31m please do a manual backup later or you could lose your access to this network\e[0m."
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment