Files
archcraft-berry/archcraft-berry.install
T
2022-04-01 18:51:16 +05:30

21 lines
709 B
Plaintext

post_install() {
local _user=`echo ${SUDO_USER:-$(whoami)}`
local _gid=`echo ${SUDO_GID}`
local _group=`cat /etc/group | grep ${_gid} | cut -d: -f1 | head -1`
local _dir="/home/${_user}/.config"
if [[ ! -d "${_dir}/berry" ]]; then
echo -e "\n[*] Copying berry config files into ${_dir}..."
mkdir -p ${_dir}/berry
cp -rf /etc/skel/.config/berry/* ${_dir}/berry/
chown -R ${_user}:${_group} ${_dir}/berry
if [[ -d "${_dir}/berry" ]]; then
echo -e "[*] Done!\n"
else
echo -e "[*] Failed!\n"
fi
else
echo -e "\n[*] Configurations for berry already exist in your config dir.\n Please copy the config files manually from '/etc/skel/.config/berry' before you login into berry.\n"
fi
}