summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/create-host-tar
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/bin/create-host-tar')
-rwxr-xr-xretiolum/bin/create-host-tar15
1 files changed, 15 insertions, 0 deletions
diff --git a/retiolum/bin/create-host-tar b/retiolum/bin/create-host-tar
new file mode 100755
index 00000000..48ce26d5
--- /dev/null
+++ b/retiolum/bin/create-host-tar
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -euf
+if [ x"${1:-}" = "x" ];then
+ echo "usage: $0 DIRECTORY"
+ exit 1
+fi
+
+WEBDIR=$1
+HOSTDIR=${HOSTDIR:-../hosts}
+HOSTFILE=$WEBDIR/hosts.tar.gz
+
+cd $(dirname $(readlink -f $0))
+rm -f $HOSTFILE
+tar czf $HOSTFILE -C $HOSTDIR .
+chmod a+rx $HOSTFILE