summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mkoverlay34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/mkoverlay b/bin/mkoverlay
new file mode 100755
index 0000000..d11a7ad
--- /dev/null
+++ b/bin/mkoverlay
@@ -0,0 +1,34 @@
+#!/bin/bash
+# = Parabola Social
+# This script is released in the Public Domain
+
+# Copies a system config file for creating a Parabola Social overlay
+# It also recreates the source dir tree.
+
+overlay_dir=/home/fauno/pkg/ParabolaSocial/overlay
+
+[[ ! -d ${overlay_dir} ]] && {
+ echo "The overlay directory doesn't exists or it's not configured."
+ exit 1
+}
+
+for file in $@; do
+ fullfile=`readlink -f ${file}`
+ destfile=${overlay_dir}${fullfile}
+
+ [[ -f ${destfile} ]] && {
+ echo "The file already exists"
+ continue
+ }
+
+ [[ ! -d `dirname ${destfile}` ]] && {
+ mkdir -p `dirname "${destfile}"`
+ }
+
+ sudo cp -p "${fullfile}" "${destfile}" || {
+ echo "Couldn't copy file"
+ exit 2
+ }
+done
+
+exit 0