From 3a63dcd77da6a3fb5eb6110e0784c7abc75c2a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sun, 24 Oct 2010 21:28:51 -0300 Subject: Added script for adding config files into overlay dir --- bin/mkoverlay | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bin/mkoverlay 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 -- cgit v1.2.2