stop using fake empty dir in home to avoid emty /home error, 0.0.1 -> 0.0.2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Profile installation
|
||||
# This file is part of the init.sh project
|
||||
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
||||
# ------------------------------------------------------------------------------
|
||||
# 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
|
||||
|
||||
local usrlist="/root"
|
||||
if find /home -mindepth 1 -maxdepth 1 -type d | read; then
|
||||
usrlist="$usrlist /home/*"
|
||||
fi
|
||||
|
||||
# Create a dir in home so /home/* is always interpreted correctly
|
||||
mkdir -pv /home/dummy
|
||||
for usr in /root /home/*; do
|
||||
for usr in $usrlist; do
|
||||
backupdist $usr/{,.}profile $usr/.bashrc
|
||||
installfile {{.,}profile,.bashrc} $usr/
|
||||
done
|
||||
|
||||
# Remove dummy dir
|
||||
rm -rf /home/dummy
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user