stop using fake empty dir in home to avoid emty /home error, 0.0.1 -> 0.0.2

This commit is contained in:
levasseur
2021-09-08 15:45:08 +02:00
parent 9253ffbe94
commit 87c7339a7e

View File

@@ -1,5 +1,6 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Profile installation # Profile installation
# This file is part of the init.sh project
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org> # Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# This file is distributed under 3-clause BSD license. # This file is distributed under 3-clause BSD license.
@@ -7,21 +8,23 @@
# https://opensource.org/licenses/BSD-3-Clause # https://opensource.org/licenses/BSD-3-Clause
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
export VER_install_profile="0.0.1" export VER_install_profile="0.0.2"
install_profile() install_profile()
{ {
installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf installfile ansi_shadow.flf /usr/share/figlet/ansi_shadow.flf
# Create a dir in home so /home/* is always interpreted correctly local usrlist="/root"
mkdir -pv /home/dummy if find /home -mindepth 1 -maxdepth 1 -type d | read; then
for usr in /root /home/*; do usrlist="$usrlist /home/*"
backupdist $usr/{,.}profile $usr/.bashrc fi
installfile {{.,}profile,.bashrc} $usr/
done
# Remove dummy dir # Create a dir in home so /home/* is always interpreted correctly
rm -rf /home/dummy for usr in $usrlist; do
backupdist $usr/{,.}profile $usr/.bashrc
installfile {{.,}profile,.bashrc} $usr/
done
unset usrlist
backupdist /etc/motd backupdist /etc/motd
installfile motd /etc/motd installfile motd /etc/motd
@@ -29,10 +32,7 @@ install_profile()
precheck_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 export -f install_profile