bin/init_homepath

27 lines
669 B
Plaintext
Raw Normal View History

2020-01-26 17:28:29 +01:00
#!/bin/sh
#
REPLACE_FOLDERS="Audio Bilder data Dokumente Downloads eclipse Musik prj Schreibtisch Videos"
2020-01-26 17:28:29 +01:00
echo The following folders will be deleted:
for folder in $REPLACE_FOLDERS; do
echo "* $HOME/\033[1m$folder\033[0m"
2020-01-26 17:28:29 +01:00
done
echo
read -r -p "Are you sure? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
for folder in $REPLACE_FOLDERS; do
if [ "$folder" = "data" ]; then
rm -f $HOME/data; ln -s /usr/data/$USER $HOME/data
else
rm -rf $HOME/$folder; ln -s /usr/data/$USER/$folder $HOME
fi
done
;;
*)
echo No folder initialisation!
;;
esac