Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # copy subversion repo's naar /data/subversion/www en geeft owner www-data
- # dit om een user colapse tussen rancid en www-data te voorkomen.
- # exit functie
- function die() { echo -e "Error in ${SCRIPT_PATH}:\n${1}"; exit 1; }
- # Global variables:
- PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'
- SCRIPT_PATH="${0}"
- HOST="${1}"
- RSYNC="rsync -alqqz"
- # for loopje:
- for SOURCEDIR in /data/subversion/rancid /data/subversion/configs
- do
- ${RSYNC} ${SOURCEDIR} /data/subversion/www || { echo "Failed to rsyc ${SOURCEDIR} to /data/subversion/www" ; continue; }
- done
- # perms
- chown -R www-data:www-data /data/subversion/www/ || die "failed to chown /data/subversion/www/ to www-data:www-data"
- find /data/subversion/www/ -type f -exec chmod 600 {} \; || die "Failed to chmod 600 all files in /data/subversion/www/"
- find /data/subversion/www/ -type d -exec chmod 700 {} \; || die "Failed to chmod 700 all directories in /data/subversion/www/"
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement