get paid to paste

Ace Of Spades 0.75 - Instalador & Configurador

#!/bin/bash
echo '
Autor ----------------> Inukaze ( Venezuela )
Sitio ----------------> inukaze.wordpress.com
Correo-E -------------> [email protected]
Licensia -------------> GPL 2

******* Inicio : Acerca de este Script ********
				  
 Es un Script sencillo para descargar
 instalar  y configurar el videojuego
 
 "Ace Of Spades 0.75"

 Requiere Tener Instalado : Wine
 
******** Fin : Acerca de este Script **********
'

#Variables :
RUTA=$(pwd)
VersionWine=$(wine --version)
WINEIC="$HOME/.wine/drive_c"
MIMESA="$HOME/.local/share/applications/mimeapps.list"
MIMESL=$(cat $HOME/.local/share/applications/mimeapps.list | grep "x-scheme-handler/aos=aos.desktop")
MIMESC="$HOME/.local/share/mime"
ARCHIVO="AceOfSpades075.tar.bz2"
ICONO="AceOfSpades.png"
URL="https://dl.dropboxusercontent.com/u/3164499"
SERVIDORES1="http://www.buildandshoot.com/portal.php"
SERVIDORES2="http://aos.acornserver.com"
CAOS="$HOME/.wine/drive_c/Ace of Spades"

# Comprobrar cosas :
# 1 - Wine instalado
if [ -z $VersionWine ]; then
echo "
No se ha detectado wine instalado

Debes instalar Wine para usarlo"
exit 1
	else
echo "
Version de Wine Detectada : $VersionWine"
$(wineboot)
fi

# 2 - Comprar que ya esta preconfigurado
if test -d "$WINEIC"
then
echo "
Wine preconfigurado encontrado"
else
	if [ -z "$VersionWine" ]; then
echo "
No se ha detectado wine instalado

Debes instalar Wine para usarlo"
exit 1
	else
echo "
Version de Wine Detectada : $VersionWine"
		$(wineboot)
	fi
	
	if test -f "$HOME/.wine/drive_c/Ace of Spades/Start"
	then
		rm "$HOME/.wine/drive_c/Ace of Spades/Start"
	fi
fi

if test -d "$CAOS"
then
echo "
La carpeta 

"'"'"$CAOS"'"'"

sera eliminada
	
Para descargar e instalar la version 0.75"
rm -rf "$CAOS"
else	
echo "
La Carpeta $CAOS no existe, sera creada"
fi

if test -f "$HOME/.local/share/aos.desktop"
then
	rm "$HOME/.local/share/aos.desktop"
fi

# Script de Instalacion & Configuracion de "Ace Of Spades"
# Descargar e Instalar
if test -d $WINEIC
then
	cd "$WINEIC"
	if test -f AceOfSpades075.tar.bz2
	then
		2>/dev/null 1>/dev/null tar xfvj "$ARCHIVO" &> /dev/null
	else
		wget "$URL/Windows/Juego%20Online/$ARCHIVO"
		wget "$URL/Linux/Iconos/$ICONO"
		2>/dev/null 1>/dev/null tar xfvj "$ARCHIVO" &> /dev/null
		cd "$RUTA"
	fi
fi

# 3 - Configurar
if [ -z "$MIMESL" ]; then
	sed -i '/\[Default Applications\]/a x-scheme-handler/aos=aos.desktop' "$MIMESA"
	else
echo "
Ya esta configurado el tipo Mime"
fi

echo '#!/bin/bash

# Solucion de Resolucion
echo `xrandr --current | grep current | awk '"'{print "'$8'"}'"'` >> /tmp/ancho
echo `xrandr --current | grep current | awk '"'{print "'$10'"}'"'` >> /tmp/alto
cat /tmp/alto | sed -i '"'s/,//g'"' /tmp/alto
ANCHO=$(cat /tmp/ancho)
ALTO=$(cat /tmp/alto)
rm /tmp/ancho /tmp/alto
echo "$ANCHO"'"x"'"$ALTO" >> /tmp/Resolucion
Resolucion=$(cat /tmp/Resolucion)
rm /tmp/Resolucion
# Solucion de Resolucion

BINARIO="$HOME/.wine/drive_c/Ace of Spades/client.exe"
$(wine "$BINARIO" -"$@" "%u") &
xrandr -s 800x600 -r 77

sleep 2
BINARIOPID=$(pidof $BINARIO)
taskset -p 0xFFFFFFFF $BINARIOPID &

while Launchers=$(pidof "client.exe")
	do   
	    sleep 1
	done
	xrandr -s $Resolucion -r 63
exit 0'|tee "$HOME/.wine/drive_c/Ace of Spades/Iniciar" &> /dev/null
chmod a+o+x "$HOME/.wine/drive_c/Ace of Spades/Iniciar"

echo '[Desktop Entry]
Name=Ace Of Spades
Exec=sh "'$HOME'/.wine/drive_c/Ace of Spades/Iniciar" %u
Icon=$HOME/.wine/drive_c/Ace of Spades/AceOfSpades.png
Type=Application
Terminal=false'|tee "$HOME/.local/share/applications/aos.desktop" &> /dev/null
chmod a+o+x "$HOME/.local/share/applications/aos.desktop"
update-mime-database $MIMESC

# Cargar el Navegador en la lista de servidores
xdg-open "$SERVIDORES1"
sleep 5
xdg-open "$SERVIDORES2"

if test -f "$WINEIC/AceOfSpades075.tar.bz2"
then
	rm "$WINEIC/AceOfSpades075.tar.bz2"
fi

Pasted: Nov 25, 2014, 4:52:48 am
Views: 29