#!/bin/sh config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW _example`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the _example copy for the admin to consider... } config etc/somad/palinsesto.cfg_example config etc/somad/soma.cfg_example config etc/somad/spot.cfg_example if [ -z `id -g soma 2> /dev/null` ]; then groupadd soma fi if [ -z `id -u soma 2> /dev/null` ]; then useradd -g soma -s /bin/false -c "Soma" -d /etc/somad soma fi chmod 600 /etc/somad/* chown -R root.soma etc/somad