bin/init_homepath

30 lines
748 B
Plaintext
Raw Normal View History

2020-01-26 17:28:29 +01:00
#!/bin/sh
#
2021-08-26 10:19:44 +02:00
BASE_FOLDERS="data Downloads media_images Videos C64"
2021-12-20 10:42:14 +01:00
VIP_FOLDERS="prj prj/Arduino Schreibtisch"
2020-01-26 17:28:29 +01:00
echo The following folders will be deleted:
2021-08-26 10:19:44 +02:00
for folder in $BASE_FOLDERS; do
echo -e "* $HOME/\033[1m$folder\033[0m"
done
for folder in $VIP_FOLDERS; do
echo -e "* $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])
2021-08-26 10:19:44 +02:00
for folder in $BASE_FOLDERS; do
2021-12-20 10:42:14 +01:00
rm -rf $HOME/`basename $folder`; ln -s /usr/data/$USER/$folder $HOME
2021-08-26 10:19:44 +02:00
done
for folder in $VIP_FOLDERS; do
2021-12-20 10:42:14 +01:00
rm -rf $HOME/`basename $folder`; ln -s /usr/data/$USER/data/$folder $HOME
done
;;
*)
echo No folder initialisation!
;;
esac