40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
# ------------------------------------------------------------------------------
|
|
# Profile installation
|
|
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
|
# ------------------------------------------------------------------------------
|
|
# This file is distributed under 3-clause BSD license.
|
|
# The complete license agreement can be obtained at:
|
|
# https://opensource.org/licenses/BSD-3-Clause
|
|
# ------------------------------------------------------------------------------
|
|
|
|
export VER_install_profile="0.0.1"
|
|
|
|
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
|
|
|
|
# Remove dummy dir
|
|
rm -rf /home/dummy
|
|
|
|
backupdist /etc/motd
|
|
installfile motd /etc/motd
|
|
}
|
|
|
|
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 precheck_install_profile
|