Added init script (symlinks confis in home dir)
This commit is contained in:
parent
d1c12a4dc1
commit
81034c833e
1 changed files with 20 additions and 0 deletions
20
init.sh
Normal file
20
init.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
BASENAME="${0##*/}"
|
||||||
|
|
||||||
|
if [ x"$1" != x ]; then
|
||||||
|
CONFIG_PATH="$1"
|
||||||
|
else
|
||||||
|
CONFIG_PATH="$HOME/config"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for FILE in $CONFIG_PATH/*; do
|
||||||
|
DOTFILE=".${FILE##*/}"
|
||||||
|
if [ "$DOTFILE" = ".${BASENAME}" ]; then continue; fi
|
||||||
|
if [ -e "$DOTFILE" ]; then
|
||||||
|
mkdir original-dot-files >/dev/null 2>/dev/null
|
||||||
|
echo "Existing file found at $DOTFILE, moving to ~/original-dot-files."
|
||||||
|
mv "$DOTFILE" original-dot-files/
|
||||||
|
fi
|
||||||
|
ln -s "$FILE" "$DOTFILE"
|
||||||
|
done
|
||||||
Loading…
Reference in a new issue