diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2010-10-24 21:28:51 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2010-10-24 21:28:51 -0300 |
commit | 3a63dcd77da6a3fb5eb6110e0784c7abc75c2a5f (patch) | |
tree | 569f6d9d45c2a4e78080d0ce47f058a50739d837 | |
parent | 09d545a26b51c8eea72d2949f06cc70cc42a74eb (diff) |
Added script for adding config files into overlay dir
-rwxr-xr-x | bin/mkoverlay | 34 |
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 |