forked from PabloCastellano/pablog-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_svn.sh
More file actions
executable file
·39 lines (30 loc) · 740 Bytes
/
create_svn.sh
File metadata and controls
executable file
·39 lines (30 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Pablo Castellano <pablo@anche.no> 2011
SVNDIR="/var/svn"
# Opcional. Da por hecho que tienes configurado libapache2-svn
SVNURL="http://svn.mydomain.net"
#----------------------------------
#Check root
if [[ $EUID -ne 0 ]]; then
echo "Solo root puede llevar a cabo esta acción"
exit
fi
#Check arguments
if [ -z $1 ]; then
echo "Necesitas especificar el nombre del repositorio"
exit
fi
if [ ! -d $SVNDIR ]; then
echo "El directorio $SVNDIR no existe"
exit
fi
cd $SVNDIR
if [ -d $1 ]; then
echo "El repositorio $1 ya existe"
exit
fi
svnadmin create $1
chown www-data:www-data $1/ -R
echo "Se ha creado el directorio $SVNDIR/$1"
echo "Clona el repositorio con el siguiente comando:"
echo " svn co $SVNURL/$1"