2020-07-01 13:42:14 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-22 06:11:00 +02:00
|
|
|
node=$(uname -n)
|
|
|
|
common_files=($(ls $PWD/common))
|
2021-01-23 12:22:53 +02:00
|
|
|
dest="$HOME/.local/bin/"
|
2020-07-01 13:42:14 +03:00
|
|
|
|
|
|
|
# Ensure destination exists
|
|
|
|
if [ ! -d "$dest" ]; then
|
|
|
|
mkdir -p "$dest"
|
|
|
|
fi
|
|
|
|
|
2022-01-08 18:52:51 +02:00
|
|
|
if [ -d "$node" ]; then
|
2021-04-09 08:56:57 +03:00
|
|
|
node_files=($(ls $PWD/$node))
|
|
|
|
for file in "${node_files[@]}"; do
|
|
|
|
ln -sf "$PWD/$node/$file" "$dest"
|
|
|
|
done
|
|
|
|
fi
|
2020-12-22 06:11:00 +02:00
|
|
|
|
|
|
|
for file in "${common_files[@]}"; do
|
2021-01-23 12:22:53 +02:00
|
|
|
ln -sf "$PWD/common/$file" "$dest"
|
2020-07-01 13:42:14 +03:00
|
|
|
done
|