dotfiles/.install/etc.sh
Severin Kaderli 22a6e47a27
All checks were successful
continuous-integration/drone/push Build is passing
Add and fix files from /etc
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2020-09-09 21:04:11 +02:00

40 lines
No EOL
1.2 KiB
Bash

#!/usr/bin/env bash
#
# SCRIPT NAME:
# etc.sh
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# Copies files to /etc
declare -A CONFIG_ETC_FILES
CONFIG_ETC_FILES=(
["/etc/cron.daily/update-mirror"]="755"
["/etc/default/tlp"]="644"
["/etc/docker/daemon.json"]="644"
["/etc/gemrc"]="644"
["/etc/logrotate.d/custom.conf"]="644"
["/etc/mkinitcpio.conf"]="644"
["/etc/NetworkManager/conf.d/dns.conf"]="644"
["/etc/pacman.conf"]="644"
["/etc/resolv.conf"]="644"
["/etc/sudoers.d/severin"]="0440"
["/etc/vconsole.conf"]="644"
["/etc/X11/nvidia-xorg.conf.d/00-keyboard.conf"]="644"
["/etc/X11/nvidia-xorg.conf.d/20-displaylink.conf"]="644"
["/etc/X11/xorg.conf.d/00-keyboard.conf"]="644"
["/etc/X11/xorg.conf.d/20-displaylink.conf"]="644"
["/etc/zsh/zshenv"]="644"
["/etc/systemd/user.conf.d/00-limits.conf"]="644"
["/etc/systemd/system.conf.d/00-limits.conf"]="644"
["/etc/locale.gen"]="644"
)
output::section "Copying /etc files"
for file in "${!CONFIG_ETC_FILES[@]}"; do
output::log "Copying ${YELLOW}${file}${DEFAULT}"
sudo install -Dm "${CONFIG_ETC_FILES[${file}]}" "${SYSTEM_DIR}${file}" "${file}" |& output::debug
done
output::success "Successfully copied /etc files"