diff --git a/config-sync/ssh-config b/config-sync/ssh-config new file mode 100644 index 0000000..6dce605 --- /dev/null +++ b/config-sync/ssh-config @@ -0,0 +1,50 @@ +Host home + HostName home.hydev.org + Port 10022 + User hykilpikonna + +Host ovh + HostName ovh.hydev.org + User root + +Host ovh2 + HostName ovh2.hydev.org + User root + +Host aster + HostName aster.hydev.org + User azalea + +Host daisy + HostName daisy.hydev.org + User azalea + +Host cn + HostName cn.hydev.org + User root + +Host nix + HostName nix.hydev.org + User root + +Host us + HostName us.hydev.org + User root + +Host lux + HostName lux.hydev.org + User root + +Host mir4 + HostName 192.168.31.1 + User root + KexAlgorithms +diffie-hellman-group1-sha1 + Cipher 3des-cbc + +Host caspase + HostName caspase3kjq.terra-incognita.dev + User kevingaojx + +Host kevin + HostName caspase3kjq.terra-incognita.dev + User me@hydev.org diff --git a/scripts/includes/config-sync.sh b/scripts/includes/config-sync.sh new file mode 100644 index 0000000..cf02de6 --- /dev/null +++ b/scripts/includes/config-sync.sh @@ -0,0 +1,28 @@ +# Sync config +check-config() +{ + file=$1 + sync=$2 + + if ! [[ -L "$file" && -f "$file" ]] + then + set -e + echo "[Config Sync] $file is not a symlink, creating symlink" + if [[ -f "$file" ]] + then + echo "> Original file $file exists." + echo "> Diff:" + diff $file $sync + bak="$file.bak" + echo "> Moving $file to $bak..." + mv $file $bak + fi + echo "> Creating symlink from $file to $sync..." + ln -s $sync $file + echo "> Done!" + fi +} + +# Sync SSH Config +alias check-ssh-config="check-config ~/.ssh/config $SCR/../config-sync/ssh-config" +check-ssh-config \ No newline at end of file