aboutsummaryrefslogtreecommitdiff
path: root/bin/makenamelink
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-05-22 21:56:04 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-05-22 21:56:04 +0000
commit82d0f92ab8b84466ae20ab919c1f9c3577b5cecb (patch)
tree776015ae6c6a386125b2d39e13b62f91b99548f8 /bin/makenamelink
downloadlh-bootstrap-82d0f92ab8b84466ae20ab919c1f9c3577b5cecb.tar.xz
Initial commit
Diffstat (limited to 'bin/makenamelink')
-rwxr-xr-xbin/makenamelink12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/makenamelink b/bin/makenamelink
new file mode 100755
index 0000000..3669693
--- /dev/null
+++ b/bin/makenamelink
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+test "$#" -ge 4 || { echo "makenamelink: too few arguments" 1>&2 ; exit 100 ; }
+
+base=${1%%/}
+link="$2"
+real="$3"
+tmp="$4"
+
+rm -f "$tmp/$link"
+ln -s "$real" "$tmp/$link"
+mv -f "$tmp/$link" "$base"/