Files
init.sh/modules/install_profile.sh
2021-11-26 11:15:55 +01:00

43 lines
1.3 KiB
Bash

# ------------------------------------------------------------------------------
# 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.
# The complete license agreement can be obtained at:
# https://opensource.org/licenses/BSD-3-Clause
# ------------------------------------------------------------------------------
export VER_install_profile="0.0.3"
export DEP_install_profile="install_pkg auth"
install_profile()
{
installfile profile/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
for usr in $usrlist; do
backupdist $usr/{.,}profile $usr/.bashrc
installfile profile/{{.,}profile,.bashrc} $usr/
installfile profile/.tmux/.tmux.conf{,.local} $usr/
done
unset usrlist
backupdist /etc/motd
installfile profile/motd /etc/motd
}
precheck_install_profile()
{
file_exists profile/{{.,}profile,.bashrc,.tmux/.tmux.conf{,.local}}
}
export -f install_profile
export -f precheck_install_profile
# EOF