#!/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