|
@@ -1,9 +1,16 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
-dt=$(date -u +'%Y-%m-%dT%H.%M.%SZ')
|
|
|
+# relpath
|
|
|
+source ../bash/functions
|
|
|
|
|
|
-cd "$( dirname "$0" )"
|
|
|
+link_path="$HOME/.screenrc"
|
|
|
+target_name="screenrc"
|
|
|
|
|
|
-mv ~/.screenrc ~/.screenrc.$dt
|
|
|
-ln -s `pwd`/screenrc ~/.screenrc
|
|
|
+script_dir="$( dirname "${BASH_SOURCE[0]}" )"
|
|
|
+target_path="$( relpath "${script_dir}/${target_name}" "$(dirname "${link_path}")" )"
|
|
|
|
|
|
+if [ -e "${link_path}" ]; then
|
|
|
+ mv --backup=numbered "$link_path" "${link_path}.old"
|
|
|
+fi
|
|
|
+
|
|
|
+ln -s "$target_path" "$link_path"
|