1
0
Fork 0

Add sync script

This commit is contained in:
Alex Kotov 2023-04-20 00:04:25 +04:00
parent 2c9eaa41eb
commit a112829b0e
1 changed files with 43 additions and 0 deletions

43
sync Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
# usage:
#
# sudo ./sync
# sudo ./sync gentoo
set -eu
REPO="$(dirname "$(realpath "$0")")"
PREFIX="${1:-''}"
sync() {
prefix="$1"
path="$2"
if [ -f "$path" ]; then
echo cp "$path" "$REPO/$prefix$path"
cp "$path" "$REPO/$prefix$path"
else
echo "Not found: $path"
fi
}
sync common '/etc/tmux.conf'
sync common '/etc/vim/vimrc.local'
sync common '/etc/fish/config.fish'
sync common '/etc/fish/conf.d/rvm.fish'
sync common '/etc/fish/functions/fish_prompt.fish'
sync common '/etc/fish/functions/prompt_user_host.fish'
sync common '/etc/fish/functions/rvm.fish'
if [ "$PREFIX" = 'gentoo' ]; then
echo
sync gentoo '/var/lib/portage/world'
sync gentoo '/etc/portage/make.conf'
sync gentoo '/etc/portage/package.license'
sync gentoo '/etc/portage/package.accept_keywords/package.accept_keywords'
sync gentoo '/etc/portage/package.mask/toolchains'
sync gentoo '/etc/portage/package.use/toolchains'
sync gentoo '/etc/portage/package.use/zz-autounmask'
fi