diff --git a/modules/install_profile.sh b/modules/install_profile.sh index 01fdf88..99d0b64 100644 --- a/modules/install_profile.sh +++ b/modules/install_profile.sh @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------------ # Profile installation +# This file is part of the init.sh project # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -7,21 +8,23 @@ # https://opensource.org/licenses/BSD-3-Clause # ------------------------------------------------------------------------------ -export VER_install_profile="0.0.1" +export VER_install_profile="0.0.2" install_profile() { installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf - # Create a dir in home so /home/* is always interpreted correctly - mkdir -pv /home/dummy - for usr in /root /home/*; do - backupdist $usr/{,.}profile $usr/.bashrc - installfile {{.,}profile,.bashrc} $usr/ - done + local usrlist="/root" + if find /home -mindepth 1 -maxdepth 1 -type d | read; then + usrlist="$usrlist /home/*" + fi - # Remove dummy dir - rm -rf /home/dummy + # Create a dir in home so /home/* is always interpreted correctly + for usr in $usrlist; do + backupdist $usr/{,.}profile $usr/.bashrc + installfile {{.,}profile,.bashrc} $usr/ + done + unset usrlist backupdist /etc/motd installfile motd /etc/motd @@ -29,10 +32,7 @@ install_profile() precheck_install_profile() { - [[ -d /home/dummy ]] && ( - prnt E "/home/dummy existe mais est réservé a un usage interne." - die 155 - ) + : } export -f install_profile