diff options
Diffstat (limited to 'sync')
-rwxr-xr-x | sync | 59 |
1 files changed, 0 insertions, 59 deletions
@@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# The most awesome sync script! :) -# This shouldn't be used anywhere else than on my PCs! - -printf "\033[0;31m" - -if [ -z "$HOME" ] || ! [ -x "$(command -v pacman)" ]; then - echo "Something went wrong!" - printf "\033[0m" - exit 1 -fi - -echo "WARNING: This will replace all your existing configs!" -read -p "Are you sure you want to do this? [yn] " -n 1 -r -if [[ ! $REPLY =~ ^[Yy]$ ]]; then - printf "\033[0m" - echo - exit 1 -fi -echo - -printf "\033[0;32m" -echo "Okay, syncing..." - -printf "\033[0;34m" -echo "Pulling newest configs" -git pull --quiet || exit 1 - -printf "\033[0;34m" -echo "Syncing packages" -sudo pacman -Syq &>/dev/null - -printf "\033[0;34m" -read -p "Do you want to install the packages? [yn] " -n 1 -r -if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Comparing installed packages" - comm -23 <(sort packages.txt) <(pacman -Qqe | sort) | yay -Sq --needed - -fi -echo - -printf "\033[0;34m" -echo "Copying configs" -printf "\033[0;37m" -cp -rv .config/ .local/ .lein/ .scripts/ .boilerplates/ .repos/ .bash_profile .bashrc .xinitrc .Xresources .gitconfig "$HOME"/ -sudo cp -rv .etc/* /etc/ - -printf "\033[0;34m" -echo "Compiling local repos" -for d in "$HOME"/.repos/*/; do (cd "$d" && sudo make clean install &>/dev/null); done || exit 1 - -printf "\033[0;34m" -echo "Syncing crypto files from server" -ping -q -w1 -c1 10.0.0.33 &>/dev/null && - scp -rq root@10.0.0.33:/mnt/ssd/.crypto "$HOME"/ || - echo "Server connection failed" - -echo "Finished!" - -printf "\033[0m" |