Files
init.sh/modules/install_profile.sh

57 lines
1.7 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.1.0"
export DEP_install_profile="install_pkg"
install_profile()
{
prnt I "Installing ansi_shadow font for figlet..."
install_file 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
prnt I "Installing profile for user $usr..."
backup_dist $usr/{.profile,.bashrc}
install_file profile/{.profile,.bashrc} $usr/
tag_file $usr/{.profile,.bashrc}
#install_file profile/.tmux/.tmux.conf{,.local} $usr/
#tag_file $usr/.tmux.conf{,.local}
if [[ ! -d $usr/profile ]]; then
(
cd $usr
git config --global http.sslverify false
git clone https://git.geoffray-levasseur.org/fatalerrors/profile.git
git config --global http.sslverify true
)
fi
done
unset usrlist
prnt I "Installing motd..."
backup_dist /etc/motd
install_file profile/motd /etc/motd
tag_file /etc/motd
}
precheck_install_profile()
{
file_must_exists profile/{motd,{.profile,.bashrc,.tmux/.tmux.conf{,.local}}
}
export -f install_profile
export -f precheck_install_profile
# EOF