Checking uname before trying to link node
This commit is contained in:
parent
95a728eba5
commit
51b18cd057
8
link.sh
8
link.sh
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
node=$(uname -n)
|
node=$(uname -n)
|
||||||
node_files=($(ls $PWD/$node))
|
|
||||||
common_files=($(ls $PWD/common))
|
common_files=($(ls $PWD/common))
|
||||||
dest="$HOME/.local/bin/"
|
dest="$HOME/.local/bin/"
|
||||||
|
|
||||||
|
@ -10,9 +9,12 @@ if [ ! -d "$dest" ]; then
|
||||||
mkdir -p "$dest"
|
mkdir -p "$dest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in "${node_files[@]}"; do
|
if [ -f "$node" ]; then
|
||||||
|
node_files=($(ls $PWD/$node))
|
||||||
|
for file in "${node_files[@]}"; do
|
||||||
ln -sf "$PWD/$node/$file" "$dest"
|
ln -sf "$PWD/$node/$file" "$dest"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
for file in "${common_files[@]}"; do
|
for file in "${common_files[@]}"; do
|
||||||
ln -sf "$PWD/common/$file" "$dest"
|
ln -sf "$PWD/common/$file" "$dest"
|
||||||
|
|
Loading…
Reference in New Issue