summaryrefslogtreecommitdiffstats
path: root/installer/install_ticket_wolunicast.sh
blob: 10c074c866c3e0ffaacae2b8d52892cd9e7e8d71 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Instalación del ticket 513: Wake-On-Lan por IP en Unicast.

# Declaración de variables. 
TICKET="513-WOL-Unicast";
SVNURLSOURCE="http://opengnsys.es/svn/branches/version1.0-tickets/Resueltos/wake_on_lan_por_IP_unicast_ticket513/";
BASEDIR="/opt/opengnsys/";
TICKETDIR="${BASEDIR}tickets/";
TARGETDIR="${TICKETDIR}${TICKET}/";
LISTTOBACKUP="${TICKETDIR}${TICKET}-BACKUP.txt";
FILEBACKUP="${TICKETDIR}${TICKET}-BACKUP.tgz";
SVNURLSOURCEBASE="http://opengnsys.es/svn/branches/version1.0/admin/Sources/";

#TODO comprobar version de opengnsys.

echo "Parando los servios."
/etc/init.d/opengnsys stop
sleep 5

mkdir -p $TARGETDIR;
echo "Descargando base de los sources"
svn export --force $SVNURLSOURCEBASE $TARGETDIR/admin/Sources;
if [ ! -d $TARGETDIR/admin/Sources ]; then
	echo "Error de acceso a los ficheros fuente" >&2
	exit 1
fi
echo "Descando modificaciones del ticket"
svn export --force $SVNURLSOURCE $TARGETDIR/;
find $TARGETDIR -name .svn -type d -exec rm -fr {} \;

## Especifico de este tiket
mv  ${TARGETDIR}/admin/WebConsole ${TARGETDIR}/www/

echo "Generando fichero de los archivos involucrados en $LISTTOBACKUP "
find  $TARGETDIR   -type f | egrep -v 'Sources|installer-info' | awk -F"$TARGETDIR" '{print $2}'  > $LISTTOBACKUP;

#compilamos el ogAdmServer
cd ${TARGETDIR}/admin/Sources/Services/ogAdmServer
make
mkdir -p ${TARGETDIR}sbin/
cp -a ${TARGETDIR}admin/Sources/Services/ogAdmServer/ogAdmServer ${BASEDIR}sbin/.
echo "sbin/ogAdmServer" >> $LISTTOBACKUP;
##

echo "Creando backup en $FILEBACKUP "
cd $BASEDIR;
[ -f $FILEBACKUP ] ||   tar czvf $FILEBACKUP -T $LISTTOBACKUP  2>/dev/null;

echo "Copiando estructura de opengnsys"
cp -av ${TARGETDIR}/[^installer][^admin]* ${BASEDIR};

echo "Inicando los servicios"
/etc/init.d/opengnsys start
sleep 5