#26 Le 03/05/2013, à 00:30
- fnux
Re : [Résolu] Comment modifier un fichier en bash par un script ".sh"?
Bonjour pingouinux.
Bonjour fnux,
1ère question :sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1|;/^Defaults\s*secure_path="/s|"\s*$|:/usr/local/go/bin"|' sudoers.modified
Attention : env-reset est différent de env_reset
Oui, tu as parfaitement raison, env-reset est une faute de frappe de ma part dans ce post.
2ème question :
echo -e 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"\nCLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar' >>environment.modified
OK, ta solution le fait en une seule ligne grâce au "\n" et m'évite un "&&".
Au fait, qu'elle est la différence entre un "&" et un "&&" ?
Si j'ai compris ce que j'ai lu à droite et à gauche, le "&" enchaine la commande suivante même si la commande précédente n'a pas abouti alors que le "&&" n'enchaine pas la commande suivante si la précédente provoque une erreur. Est-ce bien cela ?
Bon, à part ce détail, je pense grâce à tes conseils (ainsi qu'à ceux de nesthib et de Bousky) avoir presque terminé mon script (il ne me reste plus qu'à y ajouter un fichier log de résultat).
Seulement, celui-ci fait plus de 1.200 lignes et je ne pense pas qu'il soit bien que je le publie tel quel ici car il prend beaucoup de place.
Est-ce que je peux te l'envoyer (ainsi qu'à nesthib et Bousky) par mail ?
Si oui, envoie(z) moi STP un mail sur mon adresse : fnux.fl@gmail.com pour que je puisse te (vous) l'envoyer.
Encore mille mercis pour ton aide.
Dernière modification par fnux (Le 03/05/2013, à 00:31)
N'engage pas un débat lors d'un dîner car celui qui n'a pas faim aura le dernier mot. - R. Whately
FWPBLA - The Froggies West Palm Beach Linux Association.
Hors ligne
#27 Le 03/05/2013, à 05:17
- pingouinux
Re : [Résolu] Comment modifier un fichier en bash par un script ".sh"?
Au fait, qu'elle est la différence entre un "&" et un "&&" ?
ma_commande &
exécute ma_commande en arrière-plan, et rend la main (interactif) ou exécute la commande suivante (script) immédiatement.
Pour &&, voir mes explications en #8
Tu peux m'envoyer ton script si tu veux que j'y jette un œil.
Hors ligne
#28 Le 03/05/2013, à 05:26
- nesthib
Re : [Résolu] Comment modifier un fichier en bash par un script ".sh"?
Tu peux essayer de poster ton script sur le forum entre des balises [ code ], 1200 lignes ça n'est pas non plus insurmontable (si le forum l'accepte). Autrement utilise un service comme http://paste.tdct.org et donne le lien vers ton script.
GUL Bordeaux : Giroll – Services libres : TdCT.org
Hide in your shell, scripts & astuces : applications dans un tunnel – smart wget – trouver des pdf – install. auto de paquets – sauvegarde auto – ♥ awk
⃛ɹǝsn xnuᴉꞁ uʍop-ǝpᴉsdn
Hors ligne
#29 Le 05/05/2013, à 00:44
- fnux
Re : [Résolu] Comment modifier un fichier en bash par un script ".sh"?
Salut nesthib et pingouinux (et Bousky qui m'a aussi bien aidé) et à tous les autres membres du forum.
Tu peux essayer de poster ton script sur le forum entre des balises [ code ], 1200 lignes ça n'est pas non plus insurmontable (si le forum l'accepte). Autrement utilise un service comme http://paste.tdct.org et donne le lien vers ton script.
Contexte de ce script :
J'ai découvert il y a quelques temps le très controversé serveur web G-WAN.
Après l'avoir essayé, j'ai été convaincu non seulement de ses performances remarquables par rapport à ses confrères (apache2, cherokee, lighttpd et nginx) mais surtout par la possibilité qu'il offrait d'utiliser très simplement d'autres langages de programmation que PHP et Java pour développer soit des sites web2, soit des applications web riches (entre autre en ANSI C ou en C++ ou même en Objective C/C++ pour des performances hors du commun par rapport aux standards Java ou PHP habituels).
La controverse vient du fait que bien que G-WAN soit gratuit, il n'est pas open source !
Comme si tous les utilisateurs de Linux n'utilisaient aucun freeware "closed source" (pilote de cartes vidéo, pilote Flash, pilotes pour lecteur MP3 ou PDF, j'en cite et des meilleurs).
Bref, le bashing de G-WAN me semble être vraiment excessif (surtout soit de la part de ceux qui ne l'ont jamais essayé et qui déversent leur bille sans savoir, soit de la part de ceux qui ont un intérêt quelconque et surtout financier dans la promotion d'un autre serveur web - la vente de service et/ou de formation...) ce qui n'est pas très "fair play", surtout dans le monde du libre et/ou du free !
En fait, l'installation de G-WAN demande moins d'une minute (il suffit de télécharger un seul fichier de moins de 500 Kb. et de le décompresser où l'on veut).
Par contre, l'utilisation des 15 langages de programmation qu'il supporte n'est pas très facile à faire, en particulier pour Go, Mono, NodeJS ou encore de Scala si Java est déjà installé sur ta machine.
D'où toutes mes demandes d'aide pour sed car il faut modifier certains fichiers système pour que G-WAN fonctionne bien avec tous ces langages.
Donc, mon "petit" script est destiné à tous ceux qui veulent essayer un nouveau serveur web qui permet de développer des sites Web2 ou des applications Web riches aussi bien en ANSI C, ASM, C, C++, C#, Go, Java, Lua, Obective C, Objective C++, Perl, PHP, Python, Ruby ou Scala (ce que peu de ses confrères proposent sans se casser la tête pour créer des modules spécifiques pour leur serveur web préféré) tout en ayant des performances assez redoutables (les comparaisons de performances entre G-WAN et d'autres serveurs web faites avec weighttp ou clwsbt sur des PC ayant des CPU multi cores sont assez éloquentes).
Maintenant, pour se convaincre des performances des différents langages utilisés, il suffit de comparer les temps d'exécution de l'exemple loan fourni en C, C#, Java et PHP que propose G-WAN.
SI il y a des volontaires pour réécrire cet exemple loan dans les autres langages disponibles sous G-WAN juste pour le fun de comparer les vitesses d'exécution, ils sont plus que bienvenus pour m'aider car je ne suis pas spécialiste de tous ces autres langages (et même loin de la).
Mon script (is à jour en version v2m) est donc disponible ici : http://www.as2.com/linux/tools/G-WAN_fu … 2m.tar.bz2 et je n'attends que tes (vos) critiques bienvenues.
Note: Ce script est sensé fonctionner sur toutes les versions d'Ubuntu depuis la 10.04 LTS jusqu'à la version 13.10 en passant par toutes les versions intermédiaires (10.04, 10.04.1, 10.04.2, 10.04.3, 10.04.4, 11.04, 11.10, 12.04, 12.04.1, 12.04.2, et 13.04) et ce aussi bien en 32 bits qu'en 64 bits ainsi que sur Debian 6 et 7, LinuxMint 14 et 15, ArchLinux, Bridge, CentOS, Fedora 17, 18 et 19, Manjaro et Red Hat Enterprise Linux
Merci par avance de tes (vos) critiques.
Après ta (vos) réponse(s), je marquerai [Résolu].
Merci encore de toutes tes (vos) superbes explications.
PS: édité pour corriger une petite erreur dans le script.
PS: édité une seconde fois pour MAJ du lien du script en v2m multi lingues
#!/bin/sh
#
# Script: G-WAN_full-install-v2m.sh
# Date: july 20th, 2013
# Release: v2m - multi tongues - multi distros
# Author: Fnux
# e-mail: fnux.fl@gmail.com
# Licence: CC-By-Sa
#
# This script is intended to be used with any version of Ubuntu starting with
# lucid up to the last saucy, as well as with Debian squeeze and wheezy, but
# also with LinuxMint nadia and Olivia, CentOS, Fedora 17, 18 and 19 and RedHat
# as well as with Manjaro, Arch Linux and Bridge, all of these OSes both in
# 32 bits and 64 bits flavors, Desktop or Server installations.
#
# This script:
#
# - offers options to downloads and installs G-WAN and all the required tools,
# packages and dependencies to play with the 15 programming languages that you
# can use today with G-WAN.
# - backups 5 system files (/etc/environment /etc/login.defs /etc/sysyctl.conf,
# /etc/sudoers and /etc/security/limits.conf) with the ".original" extension
# accordingly to the programming languages selected.
# - modifies these 5 system files to allow G-WAN to use the 15 languages
# already available (this number depends of your OS).
# - offers an option to download and install two light and modern independant
# Web Server Benchmark tools (WEIGHTTP and CLWSBT).
# - proposes to update your system with the last security fixes and updated
# installed packages (this is hightly recommanded),
# - all the above accordingly to your installed OS release and version
# (e.g. Ubuntu 12.04 64 bit, Debian 7 32 bit, Fedora 18 64 bit, etc.)
#
# Start this script from your home folder with the root privileges:
#
# i.e. sudo ./G-WAN_full-install-v2m.sh or su ./G-WAN_full-install-v2m.sh
#
# If you need explanations about this script or if there is any broken link,
# please feel free to contact me by mail: fnux.fl@gmail.com
#
# Credits:
# --------
# Thanks for their times and tremandous advices to help me to make this script to:
#
# From the http://forum.ubuntu-fr.org community, by aphabetical order: Bousky,
# Clémentv, grim7reaper, epehj, hoper, Hizoka, MicP, nesthib, pingouinux,
# The Uploader, tiramiseb, Watael and all the others.
#
# From the http://forums.fedora-fr.org community, by aphabetical order: fgland,
# madko, nouvo09, pingou, remi and all the others.
#
# History:
# --------
# v1d : Install G-WAN and all the packages to run the different servlets
# accordingly to the OS version and its flavor - Limited to Debian
# and Ubuntu distributions.
# v2m : Add multi tongues capability: => that's why the "m" after v2.
# Add custom selection of the programming tools to be enabled for G-WAN.
# Modify the system files only if needed.
# Add the support of Cent-OS 6.4, Fedora 17, 18 and 19, LinuxMint 14 and 15,
# Manjaro and Bridge and hopefully ArchLinux (the last one isn't tested).
# todo: Test on ArchLinux (when I'll be able to install it) ;)
# Check the Deustch and Spanish messages and add other languages such as
# Italian or Dutch.
# --------------------------------------------------------------------------------
#
# get the response to start the full install
#
get_response_start()
{
case $GOFORFULLINSTALL in
'N'|'n')
#dlg196="You didn't install G-WAN.\nGoodbye."
PS1=$BLUE; $ECHO "${PS1}"; $ECHO "$dlg196"; PS1=$BACK; $ECHO "${PS1}"; $ECHO "$dlgline"; $ECHO ""; exit;;
*)
#dlg197="The G-WAN full installation starts. Please be patient..."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg197"; PS1=$BACK; $ECHO "${PS1}"; $ECHO "$dlgline";;
esac
}
# --------------------------------------------------------------------------------
#
# ask to install G-WAN and all the selected packages
#
request_start()
{
PS1=$BACK
$ECHO"${PS1}"
$ECHO "$dlgline"
PS1=$BLUE
$ECHO "${PS1}"
#dlg194="Your customisation of the G-WAN install is done."
$ECHO "$dlg194"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg195="Are you ready to install your selected packages: Y/n (empty return = Yes) ? "
read -p "$dlg195" GOFORFULLINSTALL
get_response_start
}
# --------------------------------------------------------------------------------
#
# get the response to change the G-WAN listening port
#
get_response_port()
{
case $CHANGEPORT in
'Y'|'y'|'O'['o'|'S'|'s'|'J'|'j')
#dlg220="The G-WAN listening port will be 80."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg220"; DOCHANGEPORT="Y";;
*)
#dlg221="The G-WAN listening port will stay 8080."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg221";;
esac
}
# --------------------------------------------------------------------------------
#
# ask to change to G-WAN listening port from 8080 to 80
#
request_port()
{
PS1=$RED
$ECHO "${PS1}"
#dlg217="Three last questions..."
$ECHO "$dlg217"
PS1=$BLUE
$ECHO "${PS1}"
#dlg218="By default, G-WAN listen on the port 8080."
$ECHO "$dlg218"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg219="Do you want to use the port 80 Vs. 8080 y/N (empty return = No) ? "
read -p "$dlg219" CHANGEPORT
get_response_port
}
# --------------------------------------------------------------------------------
#
# get the response to reboot the system
#
get_response_reboot()
{
case $GETWSBT in
'N'|'n')
#dlg186="Enjoy G-WAN."
#dlg187="Please read the file G-WAN_Post-Install_READ-ME.txt"
PS1=$BLUE; $ECHO "${PS1}"; $ECHO "$dlg186"; PS1=$RED; $ECHO "${PS1}"; $ECHO "$dlg187";;
*)
#dlg188="Enjoy G-WAN and have fun using WEIGHTTP and CLWSBT."
#dlg189="Please read the files G-WAN_Post-Install_READ-ME.txt and WSBT_READ-ME.txt"
PS1=$BLUE; $ECHO "${PS1}"; $ECHO "$dlg188"; PS1=$RED; $ECHO "${PS1}"; $ECHO "$dlg189"; PS1=$BACK; $ECHO "${PS1}";;
esac
case $DOREBOOT in
'N'|'n')
#dlg190="All the best."
PS1=$RED; $ECHO "${PS1}"; $ECHO "$dlg190"; PS1=$BACK; $ECHO "${PS1}"; $ECHO "$dlgline"; $ECHO ""; exit;;
*)
#dlg191="Your system will restart in 1 minute."
#dlg192="To cancel the reboot, press Ctrl C"
#dlg193="All the best."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg191"; $ECHO "$dlg192"; $ECHO "$dlg193"; PS1=$BACK; $ECHO "${PS1}"; $ECHO "$dlgline"; $ECHO ""; shutdown -r 1;;
esac
}
# --------------------------------------------------------------------------------
#
# ask for rebooting the system
#
request_reboot()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg185="Do you want to reboot your OS (highly recommended): Y/n (empty return = Yes)? "
read -p "$dlg185" DOREBOOT
PS1=$BACK
$ECHO "${PS1}"
get_response_reboot
}
# --------------------------------------------------------------------------------
#
# delete the temp folder
#
delete_temp_folder()
{
case $KEEPTEMP in
'N')
rm -R $TMPINSTALL;;
esac
}
# --------------------------------------------------------------------------------
#
# get the response to delete the temp folder
#
get_response_keep()
{
case $KEEPTEMP in
'N'|'n')
#dlg222="The $TMPINSTALL folder will be deleted."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg222"; $ECHO ""; KEEPTEMP="N";;
*)
#dlg223="The $TMPINSTALL folder will not be deleted."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg223"; PS1=$BACK; $ECHO "${PS1}";;
esac
}
# --------------------------------------------------------------------------------
#
# ask for keeping the temp folder
#
request_keep()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg183="At the end of the script, do you want to keep the $TMPINSTALL folder to"
$ECHO "$dlg183"
#dlg184="check was was done during the installation: Y/n (empty return = Yes)? "
read -p "$dlg184" KEEPTEMP
PS1=$BACK
$ECHO "${PS1}"
get_response_keep
}
# --------------------------------------------------------------------------------
#
# update the system with the last fixes and updated packages
#
update_os()
{
case $GETUPDATES in
'Y')
if [ "$VENDOR" = "Manjaro" ] || [ "$VENDOR" = "Arch" ] || [ "$VENDOR" = "Bridge" ]; then PS1=$BACK; $ECHO "${PS1}"; $DISTRO_UPDATE; else PS1=$BACK; $ECHO "${PS1}"; $DISTRO_UPDATE; $DISTRO_UPGRADE; fi ;;
esac
}
# --------------------------------------------------------------------------------
#
# get the response to update the system
#
get_response_update()
{
case $GETUPDATES in
'N'|'n')
#dlg181="Your system will not be updated at the end of the script."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg181l"; PS1=$BACK; $ECHO "${PS1}";;
*)
#dlg182="The script will look for security updates at the end of the install."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg182"; PS1=$BACK; $ECHO ""; GETUPDATES="Y";;
esac
}
# --------------------------------------------------------------------------------
#
# ask for updating the OS
#
request_update()
{
PS1=$BLUE
$ECHO "${PS1}"
#dlg175="At the end of the installation, it is recommended to \033[01;31mupdade\033[01;34m your system "
$ECHO "$dlg175"
#dlg176="to get the lastest fixed safety."
$ECHO "$dlg176"
$ECHO ""
#dlg177="However depending of your \033[01;31mSoftware Sources\033[01;34m setting, updating your OS may request"
$ECHO "$dlg177"
#dlg178="to insert your install CD (or DVD or USB stick)."
$ECHO "$dlg178"
$ECHO ""
#dlg179="So, please be prepared."
$ECHO "$dlg179"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg180="Do you want to update your OS (highly recommended): Y/n (empty return = yes)? "
read -p "$dlg180" GETUPDATES
get_response_update
}
# --------------------------------------------------------------------------------
#
# modify the system files
#
# if the system files to be modified aren't already saved with the ".original"
# extension, save the files and apply the needed modifications accordingly
# to the version and flavor of the installed system.
# if the system files are already modified with the ".modified" extension,
# nothing is done.
#
# modify the /etc/environment file for Go and Scala
#
modify_etc_environment()
{
ENVIRONMENT1=$(find $FOLDER1 -type f -iname "environment.original" | wc -l)
ENVIRONMENT2=$(find $FOLDER1 -type f -iname "environment.modified" | wc -l)
if [ "$ENVIRONMENT1" != "0" ]
then
PS1=$RED
$ECHO -n "${PS1}"
#dlg165="There is already a file $FOLDER1/environment.original"
$ECHO "$dlg165"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg166="We don't overwrite the backup."
$ECHO "$dlg166"
PS1=$BACK
$ECHO "${PS1}"
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg167="Copy $FOLDER1/environment to $FOLDER1/environment.original"
$ECHO "$dlg167"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/environment $FOLDER1/environment.original
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg168="copy $FOLDER1/environment to $TMPINSTALL/environment.original"
$ECHO "$dlg168"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/environment $TMPINSTALL/environment.original
fi
if [ "$ENVIRONMENT2" != "0" ]
then
$ECHO ""
PS1=$RED
$ECHO -n "${PS1}"
#dlg169="There is already a file $FOLDER1/environment.modified."
$ECHO "$dlg169"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg170="So we don't overwrite it nor we modify $FOLDER1/environment."
$ECHO "$dlg170"
PS1=$BACK
$ECHO "${PS1}"
else
#
# modify the /etc/environment file for Go and Scala
# - on Debian, add two lines
# - on Ubuntu, modify one line and add one line
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg171="copy $FOLDER1/environment to $TMPINSTALL/environment.modified"
$ECHO "$dlg171"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/environment $TMPINSTALL/environment.modified
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg172="modify $TMPINSTALL/environment.modified"
$ECHO "$dlg172"
PS1=$BACK
$ECHO -n "${PS1}"
chmod 777 $TMPINSTALL/environment.modified
if [ "$GETGO" = "Y" ]
then
case $VENDOR in
'Debian'|'Fedora'|'Red Hat'|'CentOS'|'Manjaro'|'Arch'|'Bridge')
$ECHO 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"' >> $TMPINSTALL"/environment.modified";;
*)
sed -i '/^PATH="/s|"\s*$|:/usr/local/go/bin"|' $TMPINSTALL"/environment.modified";;
esac
fi
if [ "$GETSCALA" = "Y" ]
then
$ECHO 'CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar' >> $TMPINSTALL"/environment.modified"
fi
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg173="copy $TMPINSTALL/environment.modified to $FOLDER1/environment"
$ECHO "$dlg173"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/environment.modified $FOLDER1/environment
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg174="copy $TMPINSTALL/environment.modified to $FOLDER1/environment.modified"
$ECHO "$dlg174"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/environment.modified $FOLDER1/environment.modified
chmod 644 $FOLDER1/environment
chmod 644 $FOLDER1/environment.modified
$ECHO ""
fi
}
# --------------------------------------------------------------------------------
#
# modify the /etc/login.defs file for Go
#
modify_etc_login_defs()
{
LOGINDEFS1=$(find $FOLDER1 -type f -iname "login.defs.original" | wc -l)
LOGINDEFS2=$(find $FOLDER1 -type f -iname "login.defs.modified" | wc -l)
if [ "$LOGINDEFS1" != "0" ]
then
PS1=$RED
$ECHO -n "${PS1}"
#dlg155="There is already a file $FOLDER1/login.defs.original"
$ECHO "$dlg155"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg156="We don't overwrite the backup."
$ECHO "$dlg156"
PS1=$BACK
$ECHO "${PS1}"
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg157="Copy $FOLDER1/login.defs to $FOLDER1/login.defs.original"
$ECHO "$dlg157"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/login.defs $FOLDER1/login.defs.original
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg158="copy $FOLDER1/login.defs to $TMPINSTALL/login.defs.original"
$ECHO "$dlg158"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/login.defs $TMPINSTALL/login.defs.original
fi
if [ "$LOGINDEFS2" != "0" ]
then
$ECHO ""
PS1=$RED
$ECHO -n "${PS1}"
#dlg159="There is already a file $FOLDER1/login.defs.modified."
$ECHO "$dlg159"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg160="So we don't overwrite it nor we modify $FOLDER1/login.defs."
$ECHO "$dlg160"
PS1=$BACK
$ECHO "${PS1}"
else
#
# modify the /etc/login.defs file to use Go
# - add /usr/local/go/bin at the end of the lines ENV_SUPATH and ENV_PATH
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg161="copy $FOLDER1/login.defs to $TMPINSTALL/login.defs.modified"
$ECHO "$dlg161"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/login.defs $TMPINSTALL/login.defs.modified
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg162="modify $TMPINSTALL/login.defs.modified"
$ECHO "$dlg162"
PS1=$BACK
$ECHO -n "${PS1}"
chmod 777 $TMPINSTALL/login.defs.modified
case $VENDOR in
'Fedora'|'Red Hat'|'CentOS')
$ECHO "ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" >> $TMPINSTALL/login.defs.modified; $ECHO "ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin" >> $TMPINSTALL/login.defs.modified;;
*)
sed -i -r '/^ENV_SUPATH/s|("?)\s*$|:/usr/local/go/bin\1|' $TMPINSTALL/login.defs.modified; sed -i -r '/^ENV_PATH/s|("?)\s*$|:/usr/local/go/bin\1|' $TMPINSTALL/login.defs.modified;;
esac
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg163="copy $TMPINSTALL/login.defs.modified to $FOLDER1/login.defs"
$ECHO "$dlg163"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/login.defs.modified $FOLDER1/login.defs
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg164="copy $TMPINSTALL/login.defs.modified to $FOLDER1/login.defs.modified"
$ECHO "$dlg164"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/login.defs.modified $FOLDER1/login.defs.modified
chmod 644 $FOLDER1/login.defs
chmod 644 $FOLDER1/login.defs.modified
$ECHO ""
fi
}
# --------------------------------------------------------------------------------
#
# modify the /etc/sudoers file for Go and Scala
#
modify_etc_sudoers()
{
SUDOERS1=$(find $FOLDER1 -type f -iname "sudoers.original" | wc -l)
SUDOERS2=$(find $FOLDER1 -type f -iname "sudoers.modified" | wc -l)
if [ "$SUDOERS1" != "0" ]
then
PS1=$RED
$ECHO -n "${PS1}"
#dlg145="There is already a file $FOLDER1/sudoers.original"
$ECHO "$dlg145"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg146="We don't overwrite the backup."
$ECHO "$dlg146"
PS1=$BACK
$ECHO "${PS1}"
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg147="Copy $FOLDER1/sudoers to $FOLDER1/sudoers.original"
$ECHO "$dlg147"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sudoers $FOLDER1/sudoers.original
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg148="copy $FOLDER1/sudoers to $TMPINSTALL/sudoers.original"
$ECHO "$dlg148"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sudoers $TMPINSTALL/sudoers.original
fi
if [ "$SUDOERS2" != "0" ]
then
$ECHO ""
PS1=$RED
$ECHO -n "${PS1}"
#dlg149="There is already a file $FOLDER1/sudoers.modified."
$ECHO "$dlg149"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg150="So we don't overwrite it nor we modify $FOLDER1/sudoers."
$ECHO "$dlg150"
PS1=$BACK
$ECHO "${PS1}"
else
#
# modify the /etc/sudoers file
# - disable the line Defaults env_reset,
# - add "Default env_keep=CLASSPATH" accordingly to $NAME to use Scala
# - add or modify Defaults secure_path accordingly to $NAME to use Go
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg151="copy $FOLDER1/sudoers to $TMPINSTALL/sudoers.modified"
$ECHO "$dlg151"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sudoers $TMPINSTALL/sudoers.modified
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg152="modify $TMPINSTALL/sudoers.modified"
$ECHO "$dlg152"
PS1=$BACK
$ECHO -n "${PS1}"
chmod 777 $TMPINSTALL/sudoers.modified
if [ "$GETGO" = "Y" ]
then
case $NAME in
'lucid'|'maverick'|'natty'|'oneiric'|'squeeze')
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1\nDefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"|' $TMPINSTALL/sudoers.modified;;
'Ascella'|'n/a')
sed -i '$aDefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"' $TMPINSTALL/sudoers.modified;;
'BeefyMiracle'|'SphericalCow'|'Schrödinger’sCat'|'Final'|'Santiago')
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1|;/^Defaults\s*secure_path =/s|\s*$|:/usr/local/go/bin|' $TMPINSTALL/sudoers.modified;;
*)
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1|;/^Defaults\s*secure_path="/s|"\s*$|:/usr/local/go/bin"' $TMPINSTALL/sudoers.modified;;
esac
fi
if [ "$GETSCALA" = "Y" ]
then
case $NAME in
'lucid'|'maverick'|'natty'|'oneiric'|'squeeze')
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1\nDefaults env_keep="CLASSPATH"|' $TMPINSTALL/sudoers.modified;;
'BeefyMiracle'|'SphericalCow'|'Schrödinger’sCat'|'Final'|'Santiago')
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1|;/^Defaults\s*env_keep =/s|"\s*$| CLASSPATH"|' $TMPINSTALL/sudoers.modified;;
*)
sed -i 's|^\(Defaults\s*env_reset.*\)$|# \1|' $TMPINSTALL/sudoers.modified;;
esac
fi
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg153="copy $TMPINSTALL/sudoers.modified to $FOLDER1/sudoers"
$ECHO "$dlg153"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/sudoers.modified $FOLDER1/sudoers
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg154="copy $TMPINSTALL/sudoers.modified to $FOLDER1/sudoers.modified"
$ECHO "$dlg154"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/sudoers.modified $FOLDER1/sudoers.modified
chmod 440 $FOLDER1/sudoers
chmod 440 $FOLDER1/sudoers.modified
$ECHO ""
fi
}
# --------------------------------------------------------------------------------
#
# modifiy the /etc/sysctl.conf file (recommanded for any web server)
#
modify_etc_sysctl_conf()
{
SYSCTLCONF1=$(find $FOLDER1 -type f -iname "sysctl.conf.original" | wc -l)
SYSCTLCONF2=$(find $FOLDER1 -type f -iname "sysctl.conf.modified" | wc -l)
if [ "$SYSCTLCONF1" != "0" ]
then
PS1=$RED
$ECHO -n "${PS1}"
#dlg135="There is already a file $FOLDER1/sysctl.conf.original"
$ECHO "$dlg135"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg136="We don't overwrite the backup."
$ECHO "$dlg136"
PS1=$BACK
$ECHO "${PS1}"
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg137="Copy $FOLDER1/sysctl.conf to $FOLDER1/sysctl.conf.original"
$ECHO "$dlg137"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sysctl.conf $FOLDER1/sysctl.conf.original
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg138="copy $FOLDER1/sysctl.conf to $TMPINSTALL/sysctl.conf.original"
$ECHO "$dlg138"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sysctl.conf $TMPINSTALL/sysctl.conf.original
fi
if [ "$SYSCTLCONF2" != "0" ]
then
$ECHO ""
PS1=$RED
$ECHO -n "${PS1}"
#dlg139="There is already a file $FOLDER1/sysctl.conf.modified."
$ECHO "$dlg139"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg140="So we don't overwrite it nor we modify $FOLDER1/sysctl.conf."
$ECHO "$dlg140"
PS1=$BACK
$ECHO "${PS1}"
else
#
# modify the /etc/sysctl.conf file
# - add all the lines below at the end of the file
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg141="copy $FOLDER1/sysctl.conf to $TMPINSTALL/sysctl.conf.modified"
$ECHO "$dlg141"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER1/sysctl.conf $TMPINSTALL/sysctl.conf.modified
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg142="modify $TMPINSTALL/sysctl.conf.modified"
$ECHO "$dlg142"
PS1=$BACK
$ECHO -n "${PS1}"
chmod 777 $TMPINSTALL/sysctl.conf.modified
sed -i '$a###################################################################' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# Modifications made to ehance the system scalability to its best' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# "Performance Scalability of a Multi-Core Web Server", Nov 2007' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# Bryan Veal and Annie Foong, Intel Corporation, Page 4/10' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$afs.file-max = 5000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.netdev_max_backlog = 400000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.optmem_max = 10000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.rmem_default = 10000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.rmem_max = 10000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.somaxconn = 100000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.wmem_default = 10000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.core.wmem_max = 10000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.conf.all.rp_filter = 1' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.conf.default.rp_filter = 1' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_congestion_control = bic' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_ecn = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_max_syn_backlog = 12000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_max_tw_buckets = 2000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_mem = 30000000 30000000 30000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_rmem = 30000000 30000000 30000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_sack = 1' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_syncookies = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_wmem = 30000000 30000000 30000000' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# optionally, avoid TIME_WAIT states on localhost no-HTTP Keep-Alive tests:' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# "error: connect failed: Cannot assign requested address (99)"' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# On Linux, the 2MSL time is hardcoded to 60 seconds in /include/net/tcp.h:' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# define Tcp_TIMEWAIT_LEN (60*HZ)' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# WARNING:' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# --------' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# The option below lets you reduce TIME_WAITs by several orders of magnitude' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# but this option is for benchmarks, NOT for production servers (NAT issues).' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# Enable this option at your own risks.' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# net.ipv4.tcp_timestamps = 1' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# other settings found from various sources to be included into sysctl.conf' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.ip_local_port_range = 1024 65535' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.ip_forward = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_dsack = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_fack = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_fin_timeout = 30' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_orphan_retries = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_keepalive_time = 120' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_keepalive_probes = 3' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_keepalive_intvl = 10' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_retries2 = 15' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_retries1 = 3' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_synack_retries = 5' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_syn_retries = 5' $TMPINSTALL/sysctl.conf.modified
sed -i '$anet.ipv4.tcp_moderate_rcvbuf = 1' $TMPINSTALL/sysctl.conf.modified
sed -i '$akernel.sysrq = 0' $TMPINSTALL/sysctl.conf.modified
sed -i '$akernel.shmmax = 67108864' $TMPINSTALL/sysctl.conf.modified
sed -i '$a#' $TMPINSTALL/sysctl.conf.modified
sed -i '$a# End of modifications' $TMPINSTALL/sysctl.conf.modified
sed -i '$a###################################################################' $TMPINSTALL/sysctl.conf.modified
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg143="copy $TMPINSTALL/sysctl.conf.modified to $FOLDER1/sysctl.conf"
$ECHO "$dlg143"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/sysctl.conf.modified $FOLDER1/sysctl.conf
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg144="copy $TMPINSTALL/sysctl.conf.modified to $FOLDER1/sysctl.conf.modified"
$ECHO "$dlg144"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/sysctl.conf.modified $FOLDER1/sysctl.conf.modified
chmod 644 $FOLDER1/sysctl.conf
chmod 644 $FOLDER1/sysctl.conf.modified
$ECHO ""
fi
}
# --------------------------------------------------------------------------------
#
# modify the /ect/security/limits.conf file (recommanded for any web server)
#
modify_etc_security_limits_conf()
{
LIMITSCONF1=$(find $FOLDER2 -type f -iname "limits.conf.original" | wc -l)
LIMITSCONF2=$(find $FOLDER2 -type f -iname "limits.conf.modified" | wc -l)
if [ "$LIMITSCONF1" != "0" ]
then
PS1=$RED
$ECHO -n "${PS1}"
#dlg125="There is already a file $FOLDER2/limits.conf.original"
$ECHO "$dlg125"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg126="We don't overwrite the backup."
$ECHO "$dlg126"
PS1=$BACK
$ECHO "${PS1}"
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg127="Copy $FOLDER2/limits.conf to $FOLDER2/limits.conf.original"
$ECHO "$dlg127"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER2/limits.conf $FOLDER2/limits.conf.original
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg128="copy $FOLDER2/limits.conf to $TMPINSTALL/limits.conf.original"
$ECHO "$dlg128"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER2/limits.conf $TMPINSTALL/limits.conf.original
fi
if [ "$LIMITSCONF2" != "0" ]
then
$ECHO ""
PS1=$RED
$ECHO -n "${PS1}"
#dlg129="There is already a file $FOLDER2/limits.conf.modified."
$ECHO "$dlg129"
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg130="So we don't overwrite it nor we modify $FOLDER2/limits.conf."
$ECHO "$dlg130"
PS1=$BACK
$ECHO "${PS1}"
else
#
# modify the /etc/security/limits.conf file
# - add the lines * soft nofile 20000 and * hard nofile 200000
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg131="copy $FOLDER2/limits.conf to $TMPINSTALL/limits.conf.modified"
$ECHO "$dlg131"
PS1=$BACK
$ECHO -n "${PS1}"
cp $FOLDER2/limits.conf $TMPINSTALL/limits.conf.modified
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg132="modify $TMPINSTALL/limits.conf.modified"
$ECHO "$dlg132"
PS1=$BACK
$ECHO -n "${PS1}"
chmod 777 $TMPINSTALL/limits.conf.modified
sed -i '$i* soft nofile 200000\n* hard nofile 200000' $TMPINSTALL/limits.conf.modified
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg133="copy $TMPINSTALL/limits.conf.modified to $FOLDER2/limits.conf"
$ECHO "$dlg133"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/limits.conf.modified $FOLDER2/limits.conf
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg134="copy $TMPINSTALL/limits.conf.modified to $FOLDER2/limits.conf.modified"
$ECHO "$dlg134"
PS1=$BACK
$ECHO -n "${PS1}"
cp $TMPINSTALL/limits.conf.modified $FOLDER2/limits.conf.modified
chmod 644 $FOLDER2/limits.conf
chmod 644 $FOLDER2/limits.conf.modified
$ECHO ""
fi
}
# --------------------------------------------------------------------------------
#
# install the weighttp and clwsbt benchmark tools
#
install_wsbt()
{
#
# download and install libev dependencies and libev-dev
#
if [ "$NAME" != "maverick" ]
then
#
# create the /home/wsbt folder and go into it
#
mkdir "$WSBTFOLDER"
chmod -R 777 "$WSBTFOLDER"
cd "$WSBTFOLDER"
#
# download the WSBT_READ-ME file
#
# wget -O "$TMPINSTALL"/WSBT_READ-ME.txt http://www.as2.com/linux/tools/WSBT_READ-ME.txt
DESTINSTALL=$TMPINSTALL
FILE="WSBT_READ-ME.txt"
SOURCE="http://www.as2.com/linux/tools/"
get_file
cp "$TMPINSTALL"/WSBT_READ-ME.txt "$WSBTFOLDER"/WSBT_READ-ME.txt
cp "$TMPINSTALL"/WSBT_READ-ME.txt "${HOME}"/WSBT_READ-ME.txt
#
# download and install libev, weighttp and clwsbt
#
$ECHO ""
PS1=$GREEN
$ECHO "${PS1}"
#dlg121="Downloading and installing libev-dev and its dependencies..."
$ECHO "$dlg121"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
case $VENDOR in
'Fedora')
PACKET="libev"; get_packet; PACKET="libev-devel"; yum-file;;
'Fedora'|'Red Hat'|'CentOS')
PACKET="libevent"; get_packet;;
'Fedora'|'CentOS')
PACKET="libevent-devel"; get_packet;;
'Ubuntu'|'Debian'|'Mint')
$DISTRO_GET build-dep libev; $DISTRO_INSTALL libev-dev;;
*)
PACKET="libevent"; get_packet; PACKET="libev"; get_packet;;
esac
$ECHO ""
PS1=$BACK
$ECHO "${PS1}"
#
# download the libev-4.15 package needed for weighttp and clwsbt and uncompress it
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg122="Downloading and installing libev..."
$ECHO "$dlg122"
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="libev-4.15.tar.gz"
SOURCE="http://dist.schmorp.de/libev/"
get_file
tar -C "$TMPINSTALL"/ -xzf "$TMPINSTALL"/libev-4.15.tar.gz
#
# go inside the libev folder and install libev
#
cd "$TMPINSTALL"/libev-4.15
./configure
make clean
make
make install
cd "${HOME}"
#
# download the weighttp package
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg123="Downloading and installing WEIGHTTP..."
$ECHO "$dlg123"
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="weighttp$FLAVOR.tar.bz2"
SOURCE="http://www.as2.com/linux/tools/"
get_file
#
# uncompress the weighttp package
#
tar -C "$TMPINSTALL"/ -xjf "$TMPINSTALL"/weighttp$FLAVOR.tar.bz2
#
# install weighttp
#
cd "${HOME}"
cp "$TMPINSTALL"/weighttp$FLAVOR /usr/local/bin/weighttp
#
# download and install the clwsbt package
#
PS1=$GREEN
$ECHO "${PS1}"
#dlg124="Downloading and installing CLWSBT..."
$ECHO "$dlg124"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="clwsbt.tar.gz"
SOURCE="http://www.as2.com/linux/tools/"
get_file
cp "$TMPINSTALL"/$FILE $WSBTFOLDER
tar -C "$WSBTFOLDER"/ -xzf "$WSBTFOLDER"/clwsbt.tar.gz
#
# go inside the WSBT folder and compile the clwsbt tool
#
cd "$WSBTFOLDER"
gcc -O2 clwsbt.c -lpthread -o clwsbt
cd "${HOME}"
#
# change the privilege access right limited by the use of sudo
#
chmod -R 777 "$WSBTFOLDER"
chmod 777 "${HOME}"/WSBT_READ-ME.txt
PS1=$BACK
$ECHO "${PS1}"
fi
}
# --------------------------------------------------------------------------------
#
# download and install NodeJS
#
install_nodejs()
{
if [ "$VENDOR" = "Arch" ] || [ "$VENDOR" = "Manjaro" ] || [ "$VENDOR" = "Bridge" ]
then
PS1=$GREEN
$ECHO "${PS1}"
#dlg119="Downloading the NodeJS (Javascript) package..."
$ECHO "$dlg119"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
PACKET="nodejs"
get_packet
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg119="Downloading the NodeJS (Javascript) package..."
$ECHO "$dlg119"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="node-v0.8.25.tar.gz"
SOURCE="http://nodejs.org/dist/v0.8.25/"
get_file
tar -C "$TMPINSTALL" -xzf "$TMPINSTALL"/node-v0.8.25.tar.gz
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg120="Installing NodeJS. Be patient since this can take up to 10 minutes."
$ECHO "$dlg120"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
cd "$TMPINSTALL"/node-v0.8.25
./configure
make clean
make
# Let the CPU cool down for 30 seconds
sleep 30
make install
PS1=$BACK
$ECHO "${PS1}"
cd "$HOME"
fi
}
# --------------------------------------------------------------------------------
#
# download and install Mono
#
install_mono()
{
PS1=$GREEN
$ECHO "${PS1}"
#dlg117="Downloading the Mono (C#) package..."
$ECHO "$dlg117"
PS1=$BACK
$ECHO "${PS1}"
sleep 3
if [ "$VENDOR" = "Manjaro" ] || [ "$VENDOR" = "Arch" ] || [ "$VENDOR" = "Bridge" ]
then
PACKET="mono"
get_packet
else
DESTINSTALL=$TMPINSTALL
FILE="mono-3.0.12.tar.bz2"
SOURCE="http://origin-download.mono-project.com/sources/mono/"
get_file
tar -C "$TMPINSTALL" -xjf "$TMPINSTALL"/mono-3.0.12.tar.bz2
$ECHO ""
PS1=$GREEN
$ECHO -n "${PS1}"
#dlg118="Installing Mono (C#=. Be patient since this can take up to 30 minutes."
$ECHO "$dlg118"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
cd "$TMPINSTALL"/mono-3.0.12
./configure --prefix=/usr
make clean
make
# let the CPU cool down for 30 seconds
sleep 30
make install
PS1=$BACK
$ECHO "${PS1}"
cd "$HOME"
fi
}
# --------------------------------------------------------------------------------
#
# download and install the Go package accordingly to the OS flavor
#
install_go()
{
$ECHO ""
PS1=$GREEN
$ECHO "${PS1}"
#dlg116="Downloading and installing the Go package..."
$ECHO "$dlg116"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
case $FLAVOR in
'32')
DESTINSTALL=$TMPINSTALL; FILE="go1.0.3.linux-386.tar.gz"; SOURCE="http://go.googlecode.com/files/"; get_file;;
*)
DESTINSTALL=$TMPINSTALL; FILE="go1.0.3.linux-amd64.tar.gz"; SOURCE="http://go.googlecode.com/files/"; get_file;;
esac
#
# uncompress the relevant Go package accordingly to the OS flavor
#
case $FLAVOR in
'32')
tar -C /usr/local -xzf "$TMPINSTALL"/go1.0.3.linux-386.tar.gz;;
*)
tar -C /usr/local -xzf "$TMPINSTALL"/go1.0.3.linux-amd64.tar.gz;;
esac
}
# --------------------------------------------------------------------------------
#
# create the symbolic links to use GNUstep
#
ls_gnustep()
{
if [ "$VENDOR" != "Arch" ] && [ "$VENDOR" != "Manjaro" ] && [ "$VENDOR" != "Bridge" ]
then
ln -s /usr/include/GNUstep/Foundation /usr/include/Foundation
ln -s /usr/include/GNUstep/GNUstepBase /usr/include/GNUstepBase
ln -s /usr/include/GNUstep/ObjectiveC2 /usr/include/ObjectiveC2
fi
}
# --------------------------------------------------------------------------------
#
# Thanx to the Fedora family for my personal trust of the yum reliability that
# helped me to take care of packets requested but not downloaded...
#
thanx_yum()
{
PACKET="tokyocabinet"
get_packet
if [ "$VENDOR" != "Red Hat" ]
then
PACKET="tokyocabinet-devel"
get_packet
fi
PACKET="sqlite"
get_packet
PACKET="sqlite-devel"
get_packet
PACKET="libmemcached"
get_packet
if [ "$VENDOR" != "Red Hat" ]
then
PACKET="libmemcached-devel"
get_packet
fi
get_packet
PACKET="cairo"
get_packet
PACKET="cairo-devel"
get_packet
PACKET="mysql"
get_packet
PACKET="mysql-devel"
get_packet
PACKET="mysql-libs"
get_packet
PACKET="gettext"
get_packet
PACKET="gettext-devel"
get_packet
PACKET="gettext-libs"
get_packet
PACKET="openssl"
get_packet
PACKET="openssl-devel"
get_packet
PACKET="tidy"
get_packet
PACKET="libtidy"
get_packet
if [ "$VENDOR" != "Red Hat" ]
then
PACKET="libtidy-devel"
get_packet
fi
if [ "$GETCPP" = "Y" ]
then
PACKET="gcc"
get_packet
PACKET="gcc-c++"
get_packet
PACKET="cpp"
get_packet
fi
if [ "$GETJAVA" = "Y" ]
then
PACKET="java-1.7.0-openjdk"
get_packet
PACKET="java-1.7.0-openjdk-devel"
get_packet
fi
if [ "$GETSCALA" = "Y" ] && [ "$VENDOR" != "CentOS" ] && [ "$VENDOR" != "Red Hat" ]
then
case $NAME in
'BeefyMiracle'|'SphericalCow') #waiting for fix for Fedora 19.
PACKET="scala"; get_packet;;
esac
fi
if [ "$GETLUA" = "Y" ]
then
PACKET="lua"
get_packet
if [ "$VENDOR" != "Red Hat" ]
then
PACKET="lua-devel"
get_packet
fi
fi
if [ "$GETOBJC" = "Y" ]
then
PACKET="gcc-objc"
get_packet
fi
if [ "$GETOBJCPP" = "Y" ]
then
PACKET="gcc-objc++"
get_packet
fi
if [ "$GETGNUSTEP" = "Y" ] && [ "$VENDOR" != "CentOS" ]
then
PACKET="gnustep-base"
get_packet
PACKET="gnustep-base-devel"
get_packet
PACKET="gnustep-make"
get_packet
fi
if [ "$GETPHP5" = "Y" ]
then
PACKET="php-cli"
get_packet
fi
if [ "$GETPYTHON" = "Y" ]
then
PACKET="python"
get_packet
PACKET="python-devel"
get_packet
PACKET="python-libs"
get_packet
fi
if [ "$GETRUBY" = "Y" ]
then
PACKET="ruby"
get_packet
PACKET="ruby-devel"
get_packet
PACKET="ruby-libs"
get_packet
fi
}
# --------------------------------------------------------------------------------
#
# Thanx to the Arch family for my personal trust of the pacman reliability that
# helped me to take care of packets requested but not downloaded...
#
thanx_pacman()
{
PACKET="memcached"
get_packet
PACKET="libmemcached"
get_packet
PACKET="mysql"
get_packet
if [ "$GETCPP" = "Y" ]
then
PACKET="gcc"
get_packet
fi
if [ "$GETJAVA" = "Y" ]
then
PACKET="jdk7-openjdk"
get_packet
fi
if [ "$GETSCALA" = "Y" ]
then
PACKET="scala"
get_packet
fi
if [ "$GETLUA" = "Y" ]
then
PACKET="lua"
get_packet
fi
if [ "$GETOBJC" = "Y" ]
then
PACKET="gcc-objc"
get_packet
fi
if [ "$GETOBJCPP" = "Y" ]
then
PACKET="gcc-objc"
get_packet
fi
if [ "$GETGNUSTEP" = "Y" ]
then
PACKET="gnustep-base"
get_packet
PACKET="gnustep-make"
get_packet
fi
if [ "$GETPHP5" = "Y" ]
then
PACKET="php"
get_packet
fi
if [ "$GETPYTHON" = "Y" ]
then
PACKET="python"
get_packet
fi
if [ "$GETRUBY" = "Y" ]
then
PACKET="ruby"
get_packet
fi
}
# --------------------------------------------------------------------------------
#
# download and install all the other needed and selected packages
#
get_packages()
{
$ECHO ""
PS1=$GREEN
$ECHO "${PS1}"
#dlg115="Downloading packages needed to use the servlets..."
$ECHO "$dlg115"
PS1=$BACK
$ECHO "${PS1}"
sleep 3
PS1=$BACK
if [ "$VENDOR" = "Debian" ] || [ "$VENDOR" = "Ubuntu" ] || [ "$VENDOR" = "Mint" ]
then
$DISTRO_INSTALL$PACKAGES
elif [ "$VENDOR" = "Fedora" ] || [ "$VENDOR" = "Red Hat" ] || [ "$VENDOR" = "CentOS" ]
then
thanx_yum
else
thanx_pacman
fi
if [ "$GETGNUSTEP" = "Y" ]
then
ls_gnustep
fi
if [ "$GETGO" = "Y" ]
then
install_go
fi
if [ "$GETMONO" = "Y" ]
then
install_mono
fi
if [ "$GETNODEJS" = "Y" ]
then
install_nodejs
fi
if [ "$GETWSBT" = "Y" ]
then
install_wsbt
fi
}
# --------------------------------------------------------------------------------
#
# donwload and install G-WAN
#
get_gwan()
{
PS1=$GREEN
$ECHO "${PS1}"
#dlg112="Downloading G-WAN..."
$ECHO "$dlg112"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="gwan_linux$FLAVOR-bit.tar.bz2"
SOURCE="http://www.gwan.ch/archives/"
get_file
$ECHO ""
PS1=$GREEN
$ECHO "${PS1}"
#dlg113="Installing G-WAN..."
$ECHO "$dlg113"
PS1=$BACK
$ECHO "${PS1}"
tar -C "${HOME}" -xjf "$TMPINSTALL"/gwan_linux$FLAVOR-bit.tar.bz2
$ECHO ""
PS1=$GREEN
$ECHO "${PS1}"
#dlg114="Downloading and installing other needed files..."
$ECHO "$dlg114"
sleep 3
PS1=$BACK
$ECHO "${PS1}"
DESTINSTALL=$TMPINSTALL
FILE="G-WAN$FLAVOR-Extra.tar.bz2"
SOURCE="http://www.as2.com/linux/tools/"
get_file
tar -C "${HOME}" -xjf "$TMPINSTALL"/G-WAN$FLAVOR-Extra.tar.bz2
DESTINSTALL=${HOME}
FILE="G-WAN_Post-Install_READ-ME.txt"
SOURCE="http://www.as2.com/linux/tools/"
get_file
#
# activate the G-WAN log folder
#
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/_logs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/logs"
#
# save the original G-WAN index.html file
#
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/www/index.html" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/www/index-original.html"
#
# enable the new index.html
#
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/www/index-new.html" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/www/index.html"
#
# disable all the cpp cs java js lua php ruby and scala servlets for maverick
#
if [ "$NAME" = "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/all.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/all.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.cs_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cpp" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cpp_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cs_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.js" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.js_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.lua" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.lua_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.php" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.php_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.rb" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.rb_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/helloscala.scala" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.scala.scala_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.cs_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.php" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.php_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/report.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/report.java_"
fi
#
# enable hello.m for lucid, natty, oneiric, precise and squeeze but let it
# disabled for quantal, raring, wheezy, olivia, SphericalCow and Schrödinger’sCat
# until a fix is found
#
if [ "$GETOBJC" = "Y" ]
then
case $NAME in
'lucid'|'natty'|'oneiric'|'precise'|'squeeze')
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.m_" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.m";;
esac
fi
#
# enable hello.mm for lucid, natty, oneiric, precise and squeeze but let it
# disabled for quantal, raring, wheezy, olivia, SphericalCow and Schrödinger’sCat
# until a fix is found
#
if [ "$GETOBJCPP" = "Y" ]
then
case $NAME in
'lucid'|'natty'|'oneiric'|'precise'|'squeeze')
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.mm_" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.mm";;
esac
fi
#
# disable the servlet hello.cpp if C++ isn't selected
#
if [ "$GETCPP" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cpp" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cpp_"
fi
fi
#
# disable the servlet argv.cs, hello.cs and loan.cs if MONO isn't selected
#
if [ "$GETMONO" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.cs_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.cs_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.cs" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.cs_"
fi
fi
#
# disable all the java servlets if JAVA isn't selected
#
if [ "$GETJAVA" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/all.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/all.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/argv.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.java_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/report.java" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/report.java_"
fi
fi
#
# disable the servlet hello.js if NODEJS isn't selected
# or if the distro is CentOS, Fedora and Red Hat.
#
if [ "$GETNODEJS" != "Y" ]
then
if [ "$NAME" != "maverick" ] || [ "$VENDOR" = "Fedora" ] || [ "$VENDOR" = "Red Hat" ] || [ "$VENDOR" = "CentOS" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.js" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.js_"
fi
fi
#
# disable the servlet hello.lua if LUA isn't selected
#
if [ "$GETLUA" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.lua" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.lua_"
fi
fi
#
# disable the servlet hello.php and loan.php if PHP-CLI isn't selected
#
if [ "$GETPHP5" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.php" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.php_"
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.php" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/loan.php_"
fi
fi
#
# disable the servlet hello.py if PYTHON isn't selected
#
if [ "$GETPYTHON" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py_"
fi
fi
#
# enable the right servlet hello.py if PYTHON is selected accordingly to $VENDOR
#
if [ "$GETPYTHON" = "Y" ]
then
if [ "$VENDOR" = "Manjaro" ] || [ "$VENDOR" = "Arch" ] || [ "$VENDOR" = "Bridge" ] && [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py_"
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py3_" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.py"
fi
fi
#
# disable the servlet hello.rb if RUBY isn't selected
#
if [ "$GETRUBY" != "Y" ]
then
if [ "$NAME" != "maverick" ]
then
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.rb" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.rb_"
fi
fi
#
# disable the scala servlet for natty, BeefyMiracle, SphericalCow, Schrödinger’sCat,
# Santiago and Final whatever if SCALA is selected or not
#
case $NAME in
'natty'|'BeefyMiracle'|'SphericalCow'|'Schrödinger’sCat'|'Final'|'Santiago')
mv "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/helloscala.scala" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/hello.scala.scala_";;
esac
#
# enable the servlet gnustep but for maverick if gnustep is selected
#
if [ "$GETGNUSTEP" = "Y" ]
then
if [ "$NAME" != "maverick" ]
then
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/gnustep.m__" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/gnustep.m"
fi
fi
#
# enable the servlet tidy.c but for maverick, Manjaro, Arch and Bridge
#
if [ "$NAME" != "maverick" ] && [ "$VENDOR" != "Manjaro" ] && [ "$VENDOR" != "Arch" ] && [ "$VENDOR" != "Bridge" ]
then
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/tidy.c_" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/tidy.c"
fi
#
# enable the servlet cairo.c but for maverick
#
if [ "$NAME" != "maverick" ]
then
cp "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/cairo.c_" "$GWANFOLDER"/0.0.0.0_8080/"#0.0.0.0/csp/cairo.c"
fi
}
# --------------------------------------------------------------------------------
#
# create the G-WAN folder and the temporary install directory
#
create_folders()
{
mkdir "$TMPINSTALL"
mkdir "$GWANFOLDER"
chmod -R 777 "$TMPINSTALL"
chmod -R 777 "$GWANFOLDER"
}
# --------------------------------------------------------------------------------
#
# get the response to install the benchmark tools
#
get_response_wsbt()
{
PS1=$GREEN
$ECHO "${PS1}"
case $WSBT in
'N'|'n')
#dlg110="WEIGHTTP and CLWSBT will not be installed on your system."
$ECHO "$dlg110"; $ECHO "";;
*)
#dlg111="WEIGHTTP and CLWSBT will be installed on your system."
$ECHO "$dlg111"; PS1=$BACK; $ECHO "${PS1}"; GETWSBT="Y";;
esac
}
# --------------------------------------------------------------------------------
#
# ask for installing the benchmark tools
#
request_wsbt()
{
if [ "$NAME" != "maverick" ]
then
PS1=$RED
$ECHO "${PS1}"
#$dlg103="You're almost done with the questions."
$ECHO "$dlg103"
PS1=$BLUE
$ECHO "${PS1}"
#dlg104="Now, two very interesting little tools to install:"
$ECHO "$dlg104"
$ECHO ""
#dlg105="WEIGHTTP and CLWSBT are 2 light and modern benchmark tools specialy made"
$ECHO "$dlg105"
#dlg106="to stress any web server (including but not limited to G-WAN) hosted on"
$ECHO "$dlg106"
#dlg107="modern systems using multi core CPUs (AMD and Intel) when simulating."
$ECHO "$dlg107"
#dlg108="increasing high loads."
$ECHO "$dlg108"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg109="Do you want to install WEIGHTTP and CLWSBT: Y/n (empty return = Yes)? "
read -p "$dlg109" WSBT
get_response_wsbt
fi
}
# --------------------------------------------------------------------------------
#
# add Ruby to the package list if the answer was yes.
#
get_response_ruby()
{
PS1=$GREEN
$ECHO "${PS1}"
case $RUBY in
'N'|'n')
#dlg101="Ruby will not be enabled for G-WAN."
$ECHO "$dlg101"; $ECHO "";;
*)
#dlg102="Ruby will be installed and enabled for G-WAN."
$ECHO "$dlg102"; $ECHO ""; GETRUBY="Y";;
esac
if [ "$GETRUBY" = "Y" ]
then
PACKAGES=$PACKAGES" ruby ruby-dev"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Ruby with G-WAN
#
request_ruby()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg100="Do you wish to use Ruby with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg100" RUBY
get_response_ruby
}
# --------------------------------------------------------------------------------
#
# add Python to the package list if the answer was yes.
#
get_response_python()
{
PS1=$GREEN
$ECHO "${PS1}"
case $PYTHON in
'N'|'n')
#dlg098="Python will not be enabled for G-WAN."
$ECHO "$dlg098"; $ECHO "";;
*)
#dlg099="Python will be installed and enabled for G-WAN."
$ECHO "$dlg099"; $ECHO ""; GETPYTHON="Y";;
esac
if [ "$GETPYTHON" = "Y" ]
then
PACKAGES=$PACKAGES" python-dev"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Python with G-WAN
#
request_python()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg097="Do you wish to use Python with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg097" PYTHON
get_response_python
}
# --------------------------------------------------------------------------------
#
# add PHP5-Cli to the packages list if the answer was yes.
#
get_response_php5cli()
{
PS1=$GREEN
$ECHO "${PS1}"
case $PHP5CLI in
'N'|'n')
#dlg095="PHP5-Cli will not be enabled for G-WAN."
$ECHO "$dlg095"; $ECHO "";;
*)
#dlg096="PHP5-Cli will be installed and enabled for G-WAN."
$ECHO "$dlg096"; $ECHO ""; GETPHP5="Y";;
esac
if [ "$GETPHP5" = "Y" ]
then
PACKAGES=$PACKAGES" php5-cli"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use PHP-Cli with G-WAN
#
request_php5cli()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg094="Do you wish to use PHP5-Cli with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg094" PHP5CLI
get_response_php5cli
}
# --------------------------------------------------------------------------------
#
# add GNUStep to the packages list if the answer was yes.
#
get_response_gnustep()
{
PS1=$GREEN
$ECHO "${PS1}"
case $GNUSTEP in
'N'|'n')
#dlg092="GNU-Step will not be enabled for G-WAN."
$ECHO "$dlg092"; $ECHO "";;
*)
#dlg093="GNU-Step will be installed and enabled for G-WAN."
$ECHO "$dlg093"; $ECHO ""; GETGNUSTEP="Y";;
esac
if [ "$GETGNUSTEP" = "Y" ]
then
PACKAGES=$PACKAGES" gnustep gnustep-make gnustep-common gnustep-devel"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use GNUStep with G-WAN
#
request_gnustep()
{
if [ "$GETOBJCPP" = "Y" ] && [ "$VENDOR" != "CentOS" ] && [ "$VENDOR" != "Red Hat" ]
then
PS1=$YELLOW
$ECHO "${PS1}"
#dlg091="Do you wish to use GNU-Step with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg091" GNUSTEP
get_response_gnustep
fi
}
# --------------------------------------------------------------------------------
#
# add Objective C++ to the packages list if the answer was yes.
#
get_response_objcpp()
{
PS1=$GREEN
$ECHO "${PS1}"
case $OBJCPP in
'N'|'n')
#dlg089="Objective C++ will not be enabled for G-WAN."
$ECHO "$dlg089"; $ECHO "";;
*)
#dlg090="Objective C++ will be installed and enabled for G-WAN."
$ECHO "$dlg090"; $ECHO ""; GETOBJCPP="Y";;
esac
if [ "$GETOBJCPP" = "Y" ]
then
PACKAGES=$PACKAGES" gobjc++"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Objective C++ with G-WAN
#
request_objcpp()
{
if [ "$GETOBJC" = "Y" ]
then
if [ "$VENDOR" != "CentOS" ] && [ "$VENDOR" != "Red Hat" ]
then
PS1=$RED
$ECHO "${PS1}"
$ECHO "$dlg210"
case $TONGUE in
'de')
$ECHO "-------";;
'es'|'fr')
$ECHO "------";;
*)
$ECHO "-----";;
esac
#dlg087="If you don't select Objective C++, you'll not be able to select Gnu-Step."
$ECHO "$dlg087"
fi
PS1=$YELLOW
$ECHO "${PS1}"
#dlg088="Do you wish to use Objective C++ with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg088" OBJCPP
get_response_objcpp
fi
}
# --------------------------------------------------------------------------------
#
# add Objective C to the packages list if the answer was yes.
#
get_response_objc()
{
PS1=$GREEN
$ECHO "${PS1}"
case $OBJC in
'N'|'n')
#dlg085="Objective C will not be enabled for G-WAN."
$ECHO "$dlg085"; $ECHO "";;
*)
#dlg086="Objective C will be installed and enabled for G-WAN."
$ECHO "$dlg086"; $ECHO ""; GETOBJC="Y";;
esac
if [ "$GETOBJC" = "Y" ]
then
PACKAGES=$PACKAGES" gobjc"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Objective C with G-WAN
#
request_objc()
{
PS1=$RED
$ECHO "${PS1}"
$ECHO "$dlg210"
case $TONGUE in
'de')
$ECHO "-------";;
'es'|'fr')
$ECHO "------";;
*)
$ECHO "-----";;
esac
#dlg083="If you don't select Objective C, you'll not be able to select Objc++."
$ECHO "$dlg083"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg084="Do you wish to use Objective C with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg084" OBJC
get_response_objc
}
# --------------------------------------------------------------------------------
#
# add Javascript server side (NodeJS) to the packages list if the answer was yes.
#
get_response_nodejs()
{
PS1=$GREEN
$ECHO "${PS1}"
case $NODEJS in
'N'|'n')
#dlg081="NodeJS (Javascript) will not be enabled for G-WAN"
$ECHO "$dlg081"; $ECHO "";;
*)
#dlg082="NodeJS (Javascript) will be installed and enabled for G-WAN"
$ECHO "$dlg082"; $ECHO ""; GETNODEJS="Y";;
esac
}
# --------------------------------------------------------------------------------
#
# ask to use Javascript server side (NodeJS) with G-WAN
#
request_nodejs()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg076="Do you wish to use Javascript (NodeJS) with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg080" NODEJS
get_response_nodejs
}
# --------------------------------------------------------------------------------
#
# add C# (Mono) to the packages list if the answer was yes.
#
get_response_mono()
{
PS1=$GREEN
$ECHO "${PS1}"
case $MONO in
'N'|'n')
#dlg078="Mono (C#) will not be enabled for G-WAN."
$ECHO "$dlg078"; $ECHO "";;
*)
#dlg079="Mono (C#) will be installed and enabled for G-WAN."
$ECHO "$dlg079"; $ECHO ""; GETMONO="Y";;
esac
}
# --------------------------------------------------------------------------------
#
# ask to use C# (Mono) with G-WAN
#
request_mono()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg077="Do you wish to use Mono (C#) with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg077" MONO
get_response_mono
}
# --------------------------------------------------------------------------------
#
# add Lua to the packages list if the answer was yes.
#
get_response_lua()
{
PS1=$GREEN
$ECHO "${PS1}"
case $LUA in
'N'|'n')
#dlg075="Lua will not be enabled for G-WAN"
$ECHO "$dlg075"; $ECHO "";;
*)
#dlg076="LUA will be installed and enabled for G-WAN"
$ECHO "$dlg076"; $ECHO ""; GETLUA="Y";;
esac
if [ "$GETLUA" = "Y" ]
then
PACKAGES=$PACKAGES" lua5.1 liblua5.1-0-dev"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Lua with G-WAN
#
request_lua()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg074="Do you wish to use LUA with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg074" LUA
get_response_lua
}
# --------------------------------------------------------------------------------
#
# add Scala to the packages list if the answer was yes.
#
get_response_scala()
{
PS1=$GREEN
$ECHO "${PS1}"
case $SCALA in
'N'|'n')
#dlg072="Scala will not be enabled for G-WAN"
$ECHO "$dlg072"; $ECHO ""; GETSCALA="N";;
*)
#dlg073="Scala will be installed and enabled for G-WAN."
$ECHO "$dlg073"; $ECHO ""; GETSCALA="Y";;
esac
if [ "$GETSCALA" = "Y" ]
then
PACKAGES=$PACKAGES" scala"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Scala with G-WAN if Java was selected
#
request_scala()
{
if [ "$GETJAVA" = "Y" ] && [ "$VENDOR" != "CentOS" ] && [ "$VENDOR" != "Red Hat" ]
then
PS1=$YELLOW
$ECHO "${PS1}"
#dlg071="Do you wish to use Scala with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg071" SCALA
get_response_scala
fi
}
# --------------------------------------------------------------------------------
#
# add Java to the packages list if the answer was yes.
#
get_response_java()
{
PS1=$GREEN
$ECHO "${PS1}"
case $JAVA in
'N'|'n')
#dlg069="Java and Scala will not be enabled for G-WAN"
$ECHO "$dlg069"; $ECHO "";;
*)
#dlg070="Java will be installed and enabled for G-WAN"
$ECHO "$dlg070"; $ECHO ""; GETJAVA="Y";;
esac
if [ "$GETJAVA" = "Y" ]
then
case $NAME in
'lucid'|'natty'|'oneiric'|'precise'|'squeeze')
PACKAGES=$PACKAGES" openjdk-6-jdk";;
*)
PACKAGES=$PACKAGES" openjdk-7-jdk";;
esac
fi
}
# --------------------------------------------------------------------------------
#
# ask to use Java with G-WAN
#
request_java()
{
if [ "$VENDOR" != "CentOS" ] && [ "$VENDOR" != "Red Hat" ]
then
PS1=$RED
$ECHO "${PS1}"
$ECHO "$dlg210"
case $TONGUE in
'de')
$ECHO "-------";;
'es'|'fr')
$ECHO "------";;
*)
$ECHO "-----";;
esac
#$dlg067="If you don't select Java, you'll not be able to select Scala."
$ECHO "$dlg067"
fi
PS1=$YELLOW
$ECHO "${PS1}"
#dlg068="Do you wish to use Java with G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg068" JAVA
get_response_java
GETSCALA="N"
}
# --------------------------------------------------------------------------------
#
# add Go to the packages list if the answer was yes.
#
get_response_go()
{
PS1=$GREEN
$ECHO "${PS1}"
case $GO in
'N'|'n')
#dlg065="Go will not be enabled for G-WAN."
$ECHO "$dlg065"; $ECHO ""; GETGO="N";;
*)
#dlg066="Go will be installed and enabled for G-WAN."
$ECHO "$dlg066"; $ECHO ""; GETGO="Y";;
esac
}
# --------------------------------------------------------------------------------
#
# ask to use Go with G-WAN
#
request_go()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg064="Do you wish to use Go with G-WAN: Y/n (empty return = Yes)? " GO
read -p "$dlg064" GO
get_response_go
}
# --------------------------------------------------------------------------------
#
# add C++ to the packages list if the answer was yes.
#
get_response_cpp()
{
PS1=$GREEN
$ECHO "${PS1}"
case $CPP in
'N'|'n')
#dlg062="C++ will not be enabled for G-WAN"
$ECHO "$dlg062"; $ECHO "";;
*)
#dlg063="C++ will be enabled for G-WAN."
$ECHO "$dlg063"; $ECHO ""; GETCPP="Y";;
esac
if [ "$GETCPP" = "Y" ]
then
PACKAGES=$PACKAGES" gcc g++"
fi
}
# --------------------------------------------------------------------------------
#
# ask to use C++ with G-WAN
#
request_cpp()
{
PS1=$YELLOW
$ECHO "${PS1}"
#dlg061="Do you wish to use C++ with G-WAN: Y/n (empty return = Yes)? " CPP
read -p "$dlg061" CPP
get_response_cpp
}
# --------------------------------------------------------------------------------
#
# install G-WAN and all the selected packages accordingly to the OS name and flavor
#
install_gwan()
{
#
# ask for the different programming languages to be enabled for G-WAN
#
if [ "$NAME" != "maverick" ]
then
PS1=$BLUE
$ECHO -n "${PS1}"
#dlg059="Now, please select the different tools you wish to use with G-WAN."
$ECHO "$dlg059"
request_cpp
request_go
request_java
request_scala
request_lua
request_mono
request_nodejs
request_objc
request_objcpp
request_gnustep
request_php5cli
request_python
request_ruby
if [ "$VENDOR" != "CentOS" ]
then
request_wsbt
fi
else
PS1=$BLUE
$ECHO -n "${PS1}"
#dlg060="Now, please say if you wish to use Go with G-WAN."
$ECHO "$dlg060"
request_go
fi
#
# ask to change the G-WAN listening port from 8080 to 80
#
request_port
#
# ask to keep the $TMPINSTALL folder
#
request_keep
#
# ask to update the OS at the end of the script
#
request_update
#
# ask to install G-WAN and all the selected packages
#
request_start
#
# create the G-WAN and temp install folders
#
create_folders
#
# get and install the selected packages to be enabled for G-WAN
#
get_packages
#
# get and install G-WAN
#
get_gwan
#
# proceed to the backup of the file systems and to their modifications
#
if [ "$GETGO" = "Y" ] || [ "$GETSCALA" = "Y" ]
then
modify_etc_environment
fi
if [ "$GETGO" = "Y" ]
then
modify_etc_login_defs
fi
if [ "$GETGO" = "Y" ] || [ "$GETSCALA" = "Y" ]
then
modify_etc_sudoers
fi
modify_etc_sysctl_conf
modify_etc_security_limits_conf
#
# change the access privileges of the files created by this script that were
# restricted to root by the use of sudo
#
cd "${HOME}"
chmod -R 777 "$TMPINSTALL"
chmod -R 777 "$GWANFOLDER"
chmod 777 "${HOME}"/G-WAN_Post-Install_READ-ME.txt
#
# change the G-WAN listening port
#
if [ "$DOCHANGEPORT" = "Y" ]
then
mv "$GWANFOLDER/0.0.0.0_8080" "$GWANFOLDER/0.0.0.0_80"
fi
delete_temp_folder
update_os
}
# --------------------------------------------------------------------------------
#
# get the response to install G-WAN
#
get_response_install()
{
case $GETGWAN in
'N'|'n')
#dlg056="G-WAN wasn't installed on your system."
#dlg057="Goodbye."
PS1=$RED; $ECHO -n "${PS1}"; $ECHO "$dlg056"; $ECHO ""; PS1=$GREEN; $ECHO -n "${PS1}"; $ECHO "$dlg057"; PS1=$BACK; $ECHO -n "${PS1}"; $ECHO "$dlgline"; $ECHO ""; exit;;
*)
#dlg058="G-WAN will be installed on your system."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg058"; PS1=$BACK; $ECHO "${PS1}"; install_gwan ;;
esac
}
# --------------------------------------------------------------------------------
#
# ask for installing G-WAN
#
request_install()
{
PS1=$BLUE
$ECHO "${PS1}"
#dlg048="The next step is to select and install G-WAN as well as all the needed"
$ECHO "$dlg048"
#dlg049="packages and dependencies to use all the different programming languages"
$ECHO "$dlg049"
#dlg050="available for your $VENDOR $RELEASE."
$ECHO "$dlg050"
$ECHO ""
#dlg051="Meanwhile, be aware that this install can last up to 45 minutes due to the"
$ECHO "$dlg051"
#dlg052="very long time to install Mono and NodeJS if you select them."
$ECHO "$dlg052"
$ECHO ""
#dlg053="BTW, The speed of this installation depends also of the power of your machine"
$ECHO "$dlg053"
#dlg054="and of your intrenet bandwith.\033[01;32m"
$ECHO "$dlg054"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg055="Do you want to install G-WAN: Y/n (empty return = Yes)? "
read -p "$dlg055" GETGWAN
get_response_install
}
# --------------------------------------------------------------------------------
#
# get the response to continue the execution of the script
#
get_response_continue()
{
case $CONTINUE in
'N'|'n')
#dlg045="You ended the script."
#dlg046="Please restart it with a right path value.\nGoodbye."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg045"; PS1=$BLUE; $ECHO "${PS1}"; $ECHO "$dlg046"; PS1=$BACK; $ECHO "${PS1}"; exit;;
*)
#dlg047="OK. Continuing the installation..."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg047"; PS1=$BACK; $ECHO "${PS1}" ;;
esac
}
# --------------------------------------------------------------------------------
#
# ask for continuing the execution of the script
#
request_continue()
{
#dlg044="Do you want to continue: Y/n (empty return = Yes) ? "
read -p "$dlg044" CONTINUE
get_response_continue
}
# --------------------------------------------------------------------------------
#
# confirm the change of the install folder
#
confirm_folder()
{
HOME=$NEWHOME
GWANFOLDER=$HOME$GWANFOLDER
WSBTFOLDER=$HOME$WSBTFOLDER
TMPINSTALL=$HOME$TMPINSTALL
PS1=$GREEN
#dlg043="OK. Now the new installation path will be: \033[01;31m"
$ECHO -n "${PS1}"
$ECHO "$dlg043"$HOME
PS1=$BACK
}
# --------------------------------------------------------------------------------
#
# get the response to confirm the new installation folder
#
get_response_confirm_folder()
{
case $CONFIRM in
'Y'|'y'|'O'|'o'|'J'|'j'|'S'|'s')
$ECHO ""; confirm_folder;;
*)
#dlg042="The installation folder wasn't changed."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg042";;
esac
}
# --------------------------------------------------------------------------------
#
# change the G-WAN installation folder
#
change_folder()
{
PS1=$BLUE
#dlg035="The G-WAN folder name must stay \033[01;31m$GWANFOLDER.\033[01;34m"
$ECHO -n "${PS1}"
$ECHO "$dlg035"
$ECHO ""
#dlg036="Please enter only a new \033[01;31mPATH\033[01;34m to place the G-WAN installation folder"
$ECHO -n "${PS1}"
$ECHO "$dlg036"
$ECHO ""
#dlg037="i.e. \033[01;31m/opt\033[01;34m) or \033[01;31m/home/user_name\033[01;34m) where \033[01;31muser_name\033[01;34m is the \033[01;31mname\033[01;34m of the user"
$ECHO "$dlg037"
#dlg038="running this script: "
$ECHO -n "$dlg038"
PS1=$BACK
$ECHO -n "${PS1}"
read -p "? " NEWHOME
if [ "$NEWHOME" != "" ]
then
PS1=$GREEN
$ECHO "${PS1}"
#dlg039="The new installation folder will be: \033[01;31m"
$ECHO "$dlg039"$NEWHOME$GWANFOLDER
PS1=$YELLOW
$ECHO "${PS1}"
#dlg040="Please confirm changing the install folder: y/N (empty return = No)?: "
read -p "$dlg040" CONFIRM
get_response_confirm_folder
else
PS1=$GREEN
$ECHO "${PS1}"
#dlg041="The installation path wasn't changed."
$ECHO "$dlg041"
fi
}
# --------------------------------------------------------------------------------
#
# get the response to change the G-WAN installation folder
#
get_response_change_folder()
{
case $CHANGE in
'Y'|'y'|'O'|'o'|'J'|'j'|'S'|'s')
$ECHO ""; change_folder;;
*)
#dlg034="The installation folder wasn't changed."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg034";;
esac
}
# --------------------------------------------------------------------------------
#
# ask for changing the installation folder
#
request_folder()
{
PS1=$BACK
$ECHO "${PS1}"
#dlgline="--------------------------------------------------------------------------------"
$ECHO "$dlgline"
PS1=$BLUE
$ECHO "${PS1}"
#dlg023="The first step is to define the folder where the script will install G-WAN."
$ECHO "$dlg023"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg024="Do you want to change the install folder: y/N (empty return = No)? "
read -p "$dlg024" CHANGE
get_response_change_folder
if [ "$CHANGE" = "Y" ] || [ "$CHANGE" = "y" ] || [ "$CHANGE" = "O" ] || [ "$CHANGE" = "o" ] || [ "$CHANGE" = "J" ] || [ "$CHANGE" = "j" ] || [ "$CHANGE" = "S" ] || [ "$CHANGE" = "s" ]
then
case $CONFIRM in
'Y'|'y'|'O'|'o'|'J'|'j'|'S'|'s')
#dlg025="So the new G-WAN install folder will be: \033[01;31m"
#dlg026="and the new WSBT install folder will be: \033[01;31m"
#dlg027=and the new TEMP install folder will be: \033[01;31m"
PS1=$BLUE; $ECHO "${PS1}"; $ECHO -n "$dlg025"; $ECHO $GWANFOLDER; $ECHO -n "${PS1}"; $ECHO -n "$dlg026"; $ECHO $WSBTFOLDER; $ECHO -n "${PS1}"; $ECHO -n "$dlg027"; $ECHO $TMPINSTALL;;
*)
#dlg028="So the G-WAN install folder will stay as: \033[01;31m"
#dlg029="and the WSBT install folder will stay as: \033[01;31m"
#dlg030="and the TEMP install folder will stay as: \033[01;31m"
GWANFOLDER=$HOME$GWANFOLDER; WSBTFOLDER=$HOME$WSBTFOLDER; TMPINSTALL=$HOME$TMPINSTALL; PS1=$BLUE; $ECHO "${PS1}"; $ECHO "$dlg028"$GWANFOLDER; PS1=$BLUE; $ECHO -n "${PS1}"; $ECHO "$dlg029"$WSBTFOLDER; PS1=$BLUE; $ECHO -n "${PS1}"; $ECHO "$dlg030"$TMPINSTALL;;
esac
else
GWANFOLDER=$HOME$GWANFOLDER
WSBTFOLDER=$HOME$WSBTFOLDER
TMPINSTALL=$HOME$TMPINSTALL
PS1=$BLUE
$ECHO "${PS1}"
#dlg031="So the G-WAN install folder will stay as:\033[01;31m"
$ECHO "$dlg031"$GWANFOLDER
PS1=$BLUE
$ECHO -n "${PS1}"
#dlg032="and the WSBT install folder will stay as:\033[01;31m"
$ECHO "$dlg032"$WSBTFOLDER
PS1=$BLUE
$ECHO -n "${PS1}"
#dlg033="and the TEMP install folder will stay as:\033[01;31m"
$ECHO "$dlg033"$TMPINSTALL
fi
PS1=$YELLOW
$ECHO "${PS1}"
request_continue
}
# --------------------------------------------------------------------------------
#
# display the introduction dialog to present the script
#
display_intro()
{
$ECHO ""
PS1=$BLUE
#dlg006="${PS1}Hello \033[01;31m$ME"
$ECHO "${PS1}$dlg006"
$ECHO "${PS1}"
#dlg007="This script installs \033[01;31mG-WAN\033[01;34m as well as all the necessary tools & dependencies"
$ECHO "$dlg007"
#dlg008="needed to play with the 15 programming languages already supported accordingly"
$ECHO "$dlg008"
#dlg009="to your OS specifications."
$ECHO "$dlg009"
$ECHO ""
#dlg010="Your OS is: \033[01;31m$SYSTEM $VENDOR $RELEASE \033[01;34mwith the following characteristics:\n"
$ECHO "$dlg010"
#dlg011="\033[01;34m Name: \033[01;31m$NAME\033[01;34m\n Flavor: \033[01;31m$FLAVOR bits\033[01;34m\n Kernel: \033[01;31m$KERNEL\033[01;34m\n"
$ECHO "$dlg011"
#dlg012=" The G-WAN install folder will be: \033[01;31m$HOME$GWANFOLDER\n\033[01;34m The WSBT install folder will be: \033[01;31m$HOME$WSBTFOLDER\n\033[01;34m The TEMP install folder will be: \033[01;31m$HOME$TMPINSTALL"
$ECHO "$dlg012"
if [ "$NAME" = "maverick" ]
then
$ECHO ""
PS1=$RED
#dlg013="Oops. \033[01;34mWe're sorry but \033[01;31m"$VENDOR $RELEASE"\033[01;34m can't be updated anymore."
$ECHO "${PS1}$dlg013"
PS1=$BLUE
$ECHO "$PS1"
#dlg014="However, you can use \033[01;31mG-WAN\033[01;34m on \033[01;31m"$VENDOR $RELEASE"\033[01;34m but you won't"
$ECHO "$dlg014"
#dlg015="be able to use C++, C#, Java, Javascript server side, Lua, Objective C/C++, PHP,"
$ECHO "$dlg015"
#dlg016="Ruby or Scala to create servlets."
$ECHO "$dlg016"
$ECHO ""
#dlg017="Meanwhile, you still will be able to use ANSI C, ASM, GO, Perl and Python."
$ECHO "$dlg017"
elif [ "$NAME" = "natty" ]
then
$ECHO ""
PS1=$RED
#dlg018="Oops. \033[01;34mWe're sorry but \033[01;31m"$VENDOR $RELEASE"\033[01;34m can't be fully updated anymore."
$ECHO "${PS1}$dlg018"
PS1=$BLUE
$ECHO "$PS1"
#dlg019="So, \033[01;31mG-WAN\033[01;34m can't use Scala with \033[01;31m"$VENDOR $RELEASE"\033[01;34m."
$ECHO "$dlg019"
$ECHO ""
#dlg020="However, you can use \033[01;31mG-WAN\033[01;34m on \033[01;31m"$VENDOR $RELEASE"\033[01;34m with ANSI C, ASM, C++, C#, Go,"
$ECHO "$dlg020"
#dlg021="Java, Javascript server side, Lua, Objective C/C++, Perl, PHP, Python and Ruby"
$ECHO "$dlg021"
#dlg022="to create servlets."
$ECHO "$dlg022"
fi
request_folder
}
# --------------------------------------------------------------------------------
#
# quit the script if the script isn't started with root privileges
#
check_root()
{
if [ "$USER" != "root" ]
then
PS1=$RED
$ECHO "${PS1}"
#dlg001="WARNING"
$ECHO "$dlg001"
case $TONGUE in
'de')
$ECHO "---------";;
'es')
$ECHO "-------------";;
'fr')
$ECHO "-----------";;
*)
$ECHO "--------";;
esac
$ECHO ""
#dlg002="This script can't be launched without the root privileges (i.e. sudo or su)."
$ECHO "$dlg002"
PS1=$BLUE
$ECHO "${PS1}"
#dlg003="Please restart the script with the command: \033[01;37msudo ./G-WAN_full-install-v2m.sh\033[01;34m"
$ECHO "$dlg003"
#dlg004="or use the \033[01;37msu\033[01;34m account and start: \033[01;37m./G-WAN_full-install-v2m.sh\033[01;34m"
$ECHO "$dlg004"
$ECHO ""
#dlg005="Goodbye."
$ECHO "${PS1}$dlg005"
PS1=$BACK
$ECHO "${PS1}"
exit
fi
}
# --------------------------------------------------------------------------------
#
# Set the messages in spanish
#
set_language_es()
{
dlgline="--------------------------------------------------------------------------------"
dlg001="ADVERTENCIA :"
dlg002="Este script no puede ponerse en marcha sin los privilegios de root\n(por ejemplo sudo o su)."
dlg003="Por favor, reinicie la secuencia de comandos con el comando:\n\033[01;37msudo ./G-WAN_full-install-v2m.sh \033[01;34m\n"
dlg004="o utilice el \033[01;31mroot \033[01;34mcuenta y arranque: \033[01;37m./G-WAN_full-install-v2m.sh"
dlg005="Adios."
dlg006="Hola \033[01;31m$ME"
dlg007="Este script instala \033[01;31mG-WAN \033[01;34mas asi como todas las herramientas y dependencias"
dlg008="necesario para jugar con los lenguajes de programacion ya apoyo en consecuencia"
dlg009="a sus especificaciones del sistema operativo."
dlg010="Su sistema operativo es: \033[01;31m$SYSTEM $VENDOR $RELEASE \033[01;34mcon las siguientes caracteristicas: \n"
dlg011="\033[01;34mNombre: \033[01;31m $NAME \033[01;34m \nSabor: \033[01;31m $FLAVOR bit \033[01;34m \nKernel: \033[01;31m $KERNEL \033[01;34m\n"
dlg012="La carpeta de instalacion del G-WAN sera: \033[01;31m $HOME$GWANFOLDER \n\033[01;34mLa carpeta de instalacion del WSBT sera: \033[01;31m $HOME$WSBTFOLDER \n\033[01;34mLa carpeta TEMP instalacion sera: \033[01;31m $HOME$TMPINSTALL "
dlg013="Oops \033[01;34m Lo sentimos, pero \033[01;31m$VENDOR $RELEASE \033[01;34mno puede se actualizara mas"
dlg014="Sin embargo, puede utilizar \033[01;31m G-WAN \033[01;34men \033[01;31m$VENDOR $RELEASE \033[01;34mbut no lo haras"
dlg015="poder utilizar C++, C#, Java, Javascript lado del servidor, Lua, Objective C/C++, PHP,"
dlg016="Ruby o Scala para crear servlets."
dlg017="Mientras tanto, usted todavia sera capaz de utilizar ANSI C, ASM, GO, Perl y Python."
dlg018="Oops \033[01;34m Lo sentimos, pero \033[01;31m$VENDOR $RELEASE \033[01;34mno puede estar completamente actualizado mas"
dlg019="Por lo tanto, \033[01;31mG-WAN \033[01;34mno puede uso Scala con \033[01;31m$VENDOR $RELEASE \033[01;34m"
dlg020="Sin embargo, puede utilizar \033[01;31m G-WAN \033[01;34 m\033[01;31m$VENDOR $RELEASE \033[01;34mcon ANSI C, ASM, C++, C#, Go , "
dlg021="Java, Javascript lado del servidor, Lua, Objective C/C++, Perl, PHP, Python y Ruby"
dlg022="para crear servlets."
dlg023="El primer paso es definir en el script instalara G-WAN".
dlg024="Desea cambiar la carpeta de instalacion: s/N (retorno vacio = No)? "
dlg025="La nueva carpeta de instalacion G-WAN sera : \033[01;31m"
dlg026="y la nueva carpeta de instalacion WSBT sera : \033[01;31m"
dlg027="y la nueva carpeta de instalacion TEMP sera : \033[01;31m"
dlg028="La carpeta de instalacion del G-WAN quedara como : \033[01;31m"
dlg029="y la carpeta de instalacion WSBT quedara como : \033[01;31m"
dlg030="y la carpeta de instalacion TEMP se quedara como : \033[01;31m"
dlg031="La carpeta de instalacion del G-WAN quedara como : \033[01;31m"
dlg032="y la carpeta de instalacion WSBT quedara como : \033[01;31m"
dlg033="y la carpeta de instalacion TEMP quedara como : \033[01;31m"
dlg034="La carpeta de instalacion no se ha cambiado."
dlg035="El nombre de la carpeta G-WAN debe estar: \033[01;31m$GWANFOLDER \033[01;34m"
dlg036="Por favor, introduzca solo un nuevo\033[01;31m CAMINO\033[1;34m la carpeta to lugar G-WAN instalacion"
dlg037="pe \033[01;31m/opt \033[01;34mo \033[01;31m/home/nombre_usuario \033[01;34mdonde \033[01;31m'nombre_usuario' \033[01;34mes la\033[01;31m nombre\033[01;34m del usuario "
dlg038="esta secuencia de comandos:\033[01;34m"
dlg039="La nueva carpeta de instalacion sera: \033[01;31m"
dlg040="Confirme el cambio de la carpeta de instalacion: s/N (retorno vacio = No)? "
dlg041="La ruta de instalacion no se ha cambiado."
dlg042="La carpeta de instalacion no se ha cambiado."
dlg043="Ahora bien la ruta de instalacion sera:\033[01;31m"
dlg044="Desea continuar: S/n (retorno vacio = Si)? "
dlg045="Se termino el script."
dlg046="Por favor, reinicie con un valor mas camino correcto.\nAdios."
dlg047="OK. Continuacion de la instalacion ..."
dlg048="El siguiente paso es seleccionar e instalar G-WAN, asi como todo lo necesario"
dlg049="paquetes y dependencias para utilizar todos los diferentes lenguajes de "
dlg050="programacion disponibles para G-WAN con $VENDOR $RELEASE".
dlg051="Mientras tanto tenga en cuenta que esta instalacion puede durar hasta 45 minutos"
dlg052="debido a la mucho tiempo para instalar Mono y NodeJS si los selecciona."
dlg053="Por cierto, la velocidad de esta instalacion depende tambien de la potencia de"
dlg054="su maquina y de su ancho de banda intrenet \033[01;32m"
dlg055="Desea instalar el G-WAN : S/n (retorno vacio = Si)? "
dlg056="Nada se ha instalado en su sistema."
dlg057="Adios."
dlg058="G-WAN se instalara en su sistema."
dlg059="Por favor, seleccionar los diferentes idiomas que desea utilizar con el G-WAN".
dlg060="Ahora, por favor, decir que si usted desea utilizar Vaya con G-WAN".
dlg061="Desea usar C++ con el G-WAN : S/n (retorno vacio = Si)? "
dlg062="C++ no sera habilitado G-WAN".
dlg063="C++ sera instalado y habilitado G-WAN".
dlg064="Desea usar Java con G-WAN : S/n (retorno vacio = Si)? "
dlg065="Go no se habilitara para G-WAN".
dlg066="Go sera instalado y habilitado para G-WAN".
dlg067="Si no selecciona Java ahora, vas a no ser capaz de seleccionar Scala despues."
dlg068="Te deseo de utilizar Java con G-WAN : S/n (retorno vacio = Si)? "
dlg069="Java no se habilitara para el G-WAN".
dlg070="Java se instala y habilita para G-WAN".
dlg071="Desea utilizar Scala con G-WAN : S/n (retorno vacio = Si)? "
dlg072="Scala no se habilitara para el G-WAN".
dlg073="Scala sera instalado y habilitado para G-WAN".
dlg074="Desea utilizar LUA con G-WAN : S/n (retorno vacio = Si)? "
dlg075="Lua no se habilitara para el G-WAN".
dlg076="LUA sera instalado y habilitado para G-WAN".
dlg077="Desea usar Mono (C#) con G-WAN : S/n (retorno vacio = Si)? "
dlg078="Mono [C#) no se habilitara para el G-WAN".
dlg079="Mono [C#) sera instalado y habilitado para G-WAN".
dlg080="Desea utilizar NodeJS (Javascript) con G-WAN : S/n (retorno vacio = Si)? "
dlg081="NodeJS (Javascript) no se habilitara para el G-WAN".
dlg082="NodeJS (Javascript) sera instalado y habilitado para G-WAN".
dlg083="Si no selecciona Objective C, usted no sera capaz de seleccionar ObjC++."
dlg084="Desea utilizar Objective C con G-WAN : S/n (retorno vacio = Si)? "
dlg085="Objective C y Objective C++ no sera habilitado G-WAN".
dlg086="Objective C sera instalado y habilitado para G-WAN".
dlg087="Si no selecciona Objective C++, usted no sera capaz de seleccionar Gnu-Step".
dlg088="Desea utilizar Objective C++ con el G-WAN : S/n (retorno vacio = Si)? "
dlg089="Objective C++ no sera habilitado G-WAN".
dlg090="Objective C++ sera instalado y habilitado G-WAN".
dlg091="Desea utilisar GNU-Step con G-WAN : S/n (retorno vacio = Si)? "
dlg092="GNU-Step no se habilitara para el G-WAN".
dlg093="GNU-Step sera instalado y habilitado para G-WAN".
dlg094="Desea usar PHP5-Cli con G-WAN : S/n (retorno vacio = Si)? "
dlg095="PHP5-Cli no se habilitara para el G-WAN".
dlg096="PHP5-Cli sera instalado y habilitado para G-WAN".
dlg097="Desea usar Python con G-WAN : S/n (retorno vacio = Si)? "
dlg098="Python no se habilitara para el G-WAN".
dlg099="Python se instala y habilita para G-WAN".
dlg100="Desea usar Ruby con G-WAN : S/n (retorno vacio = Si)? "
dlg101="Ruby no se habilitara para el G-WAN".
dlg102="Ruby sera instalado y habilitado para G-WAN".
dlg103="Ya casi ha terminado con las preguntas."
dlg104="Ahora, dos pequenas herramientas muy interesantes para instalar:"
dlg105="WEIGHTTP y CLWSBT son 2 herramientas de referencia claros y modernos"
dlg106="especialmente hechas al estres cualquier servidor web, incluyendo, pero no "
dlg107="limitado a G-WAN alojado en sistemas modernos utilizan CPUs de multiples nucleos"
dlg108="(AMD e Intel) al simular aumentar cargas elevadas."
dlg109="Desea instalar WEIGHTTP y CLWSBT : S/n (retorno vacio = Si)? "
dlg110="WEIGHTTP y CLWSBT no se instalaran en su sistema."
dlg111="WEIGHTTP y CLWSBT se instalaran en su sistema."
dlg112="Descarga de G-WAN ..."
dlg113="Instalacion de G-WAN ..."
dlg114="Descargar e instalar otros archivos necesarios ..."
dlg115="Descarga de paquetes necesarios para utilizar los servlets ..."
dlg116="Descargar e instalar el paquete Go ..."
dlg117="Descargando el paquete Mono (C#) ..."
dlg118="Instalacion de Mono (C#). Sea paciente, ya que puede tardar hasta 30 minutos."
dlg119="Descargando el paquete NodeJS (Javascript) ..."
dlg120="Instalacion NodeJS. Sea paciente, ya que puede tardar hasta 10 minutos."
dlg121="Descarga e instalacion libev-dev y sus dependencias ..."
dlg122="Descarga e instalacion libev ..."
dlg123="Descarga e instalacion WEIGHTTP ..."
dlg124="Descarga e instalacion CLWSBT ..."
dlg125="Ya existe un archivo $FOLDER2/limits.conf.original"
dlg126="No sobrescribir la copia de seguridad."
dlg127="Copiar $FOLDER2/limits.conf a $FOLDER2/limits.conf.original"
dlg128="Copiar $FOLDER2/limits.conf a $TMPINSTALL/limits.conf.original"
dlg129="Ya existe un archivo $FOLDER2/limits.conf.modified."
dlg130="Asi que no sobrescribirlo ni modificamos $FOLDER2/limits.conf."
dlg131="Copiar $FOLDER2/limits.conf a $TMPINSTALL/limits.conf.modified"
dlg132="Modificar $TMPINSTALL/limits.conf.modified"
dlg133="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER2/limits.conf"
dlg134="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER2/limits.conf.modified"
dlg135="Ya existe un archivo $FOLDER1/sysctl.conf.original"
dlg136="No sobrescribir la copia de seguridad."
dlg137="Copiar $FOLDER1/sysctl.conf a $FOLDER1/sysctl.conf.original"
dlg138="copy $FOLDER1/sysctl.conf a $TMPINSTALL/limits.conf.original"
dlg139="Ya existe un archivo $FOLDER1/sysctl.conf.modified."
dlg140="Asi que no sobrescribirlo ni modificamos $FOLDER1/sysctl.conf."
dlg141="Copiar $FOLDER1/sysctl.conf a $TMPINSTALL/limits.conf.modified"
dlg142="Modificar $TMPINSTALL/limits.conf.modified"
dlg143="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/sysctl.conf"
dlg144="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/sysctl.conf.modified"
dlg145="Ya existe un archivo $FOLDER1/sudoers.original"
dlg146="No sobrescribir la copia de seguridad."
dlg147="Copiar $FOLDER1/sudoers a $FOLDER1/sudoers.original"
dlg148="Copiar $FOLDER1/sudoers a $TMPINSTALL/limits.conf.original"
dlg149="Ya existe un archivo $FOLDER1/sudoers.modified."
dlg150="Asi que no sobrescribirlo ni modificamos $FOLDER1/sudoers."
dlg151="Copiar $FOLDER1/sudoers a $TMPINSTALL/limits.conf.modified"
dlg152="Modificar $TMPINSTALL/limits.conf.modified"
dlg153="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/sudoers"
dlg154="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/sudoers.modified"
dlg155="Ya existe un archivo $FOLDER1/login.defs.original"
dlg156="No sobrescribir la copia de seguridad."
dlg157="Copiar $FOLDER1/login.defs a $FOLDER1/login.defs.original"
dlg158="Copiar $FOLDER1/login.defs a $TMPINSTALL/limits.conf.original"
dlg159="Ya existe un archivo $FOLDER1/login.defs.modified."
dlg160="Asi que no sobrescribirlo ni modificamos $FOLDER1/login.defs."
dlg161="Copiar $FOLDER1/login.defs a $TMPINSTALL/limits.conf.modified"
dlg162="Modificar $TMPINSTALL/limits.conf.modified"
dlg163="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/login.defs"
dlg164="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/login.defs.modified"
dlg165="Ya existe un archivo $FOLDER1/environment.original"
dlg166="No sobrescribir la copia de seguridad."
dlg167="Copiar $FOLDER1/environment a $FOLDER1/environment.original"
dlg168="Copiar $FOLDER1/environment a $TMPINSTALL/limits.conf.original"
dlg169="Ya existe un archivo $FOLDER1/environment.modified."
dlg170="Asi que no sobrescribirlo ni modificamos $FOLDER1/environment."
dlg171="Copiar $FOLDER1/environment a $TMPINSTALL/limits.conf.modified"
dlg172="Modificar $TMPINSTALL/limits.conf.modified"
dlg173="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/environment"
dlg174="Copiar $TMPINSTALL/limits.conf.modified a $FOLDER1/environment.modified"
dlg175="Al final de la instalación, se recomienda \033[01;31mactualizar\033[01;34m el sistema para obtener "
dlg176="la última de seguridad fijo."
dlg177="Sin embargo, dependiendo de su \033[01;31mOrígenes del Software\033[01;34m configuracion, la actualizacion de su OS"
dlg178="pueden solicitar para insertar el CD de instalacion (o DVD o memoria USB)."
dlg179="Por lo tanto, por favor este preparado."
dlg180="Desea actualizar su sistema operativo (muy recomendable): S/n (retorno vacio = Si)? "
dlg181="Buscando actualizaciones e instalarlas en su caso."
dlg182="La secuencia de comandos buscara actualizaciones de seguridad al final de la instalacion."
dlg183="Al final de la secuencia de comandos, desea guardar la carpeta $TMPINSTALL"
dlg184="comprobar fue que se hizo durante la instalacion: S/n (retorno vacio = Si)"
dlg185="Desea reiniciar su sistema operativo (muy recomendable): S/n (retorno vacio = Si)? "
dlg186="Disfrute de la G-WAN".
dlg187="Por favor, lea el archivo G-WAN_Post-Install_READ-Me.txt"
dlg188="Disfrute de la G-WAN y divertirse con WEIGHTTP y CLWSBT."
dlg189="Por favor, lea los archivos G-WAN_Post-Install_READ-Me.txt y WSBT_READ-Me.txt"
dlg190="Te deseo lo mejor."
dlg191="Su sistema se reiniciara en 1 minuto ..."
dlg192="Para cancelar el reinicio, pulse Ctrl C"
dlg193="Te deseo lo mejor."
dlg194="Su personalizacion de la instalacion G-WAN se hace."
dlg195="Estas listo para instalar los paquetes seleccionados: S/n (retorno vacio = Si)? "
dlg196="Usted no inicia la instalacion G-WAN. \ngood Adios."
dlg197="Se inicia la instalacion completa de G-WAN. Gracias por su paciencia ..."
dlg198="Hola $ME.\n\nDebe instalar lsb-release para utilizar este script."
dlg199="Desea instalar lsb-release ahora: S/n (vacio retrun = Si)?"
dlg200="Este script no puede continuar sin lsb-release \n\n\033[01;34mPor favor instale lsb-release y reiniciar la secuencia de comandos\nAdios.\033[0m"
dlg201="Debe instalar wget para utilizar este script."
dlg202="Hola $ME.\n\nDesea instalar wget ahora: S/n (retorno vacio = Si)? "
dlg203="Este script no puede continuar sin wget \n\n\033[01;34mPor favor instale wget (sudo yum-y install wget) y reiniciar la secuencia de comandos\nAdios.\033[0m"
dlg204="\033[01;31mLo siento, pero despues de "
dlg205=" intentos, no puedo descargar "
dlg206="Quieres volver a intentar en este momento: s/N (retorno vacio = No)? "
dlg207="\033[01;32mVolver a intentar descargar \033[0m"
dlg208="\033[01;31mEste script no puede continuar sin "
dlg209="\n\n\033[01;34mPor favor verifique su conexion a Internet y reiniciar\nel script.\nAdios.\033[0m"
dlg210="NOTE:"
dlg211="\033[01;31mLo sentimos, pero despues de "
dlg212=" intentos, no puedo instalar "
dlg213="Quieres volver a intentar en este momento: s/N (retorno vacio = No)? "
dlg214="033[01;32mVolver a intentar instalar el \033[0m"
dlg215="\033[01;31mEste script no puede continuar sin "
dlg216="\n\n\033[01;34mPor favor verifique su conexion a Internet y reiniciar\nel script.\nAdios.\033[0m"
dlg217="Tres ultimas preguntas..."
dlg218="De forma predeterminada, G-WAN esta escuchando en el puerto 8080."
dlg219="Quieres utilizar el puerto 80 en lugar de 8080 s/N (retorno vacio = No)? "
dlg220="El puerto de escucha del G-WAN sera 80."
dlg221="El puerto de escucha del G-WAN permanecera 8080."
dlg222="Se eliminara la carpeta $TMPINSTALL."
dlg223="No se borrara la carpeta $TMPINSTALL."
}
#
# Set the messages in deutsch
#
set_language_de()
{
dlgline="--------------------------------------------------------------------------------"
dlg001="Hallo $ME.\n\nWARNUNG :"
dlg002="Dieses Skript kann nicht ohne die Root-Rechte (dh sudo su oder) gestartet werden"
dlg003="Bitte starten Sie das Skript mit dem Befehl: \033[01;37msudo ./G-WAN_full-install-v2m.sh \033[01;34m"
dlg004="oder verwenden Sie die \033[01;31m root \033[01;34mrechnung und Start: \033[01;37m./G-WAN_full-install-v2m.sh"
dlg005="Auf Wiedersehen".
dlg006="Hallo \033[01;31m $ME"
dlg007="Dieses Skript installiert \033[01;31mG-WAN \033[01;34msowie alle notwendigen Werkzeuge und"
dlg008="Abhangigkeiten benotigt, um mit den 15 Programmiersprachen bereits entsprechend "
dlg009="Ihren OS Spezifikationen unterstutzt spielen."
dlg010="Ihr OS ist: \033[01;31m $SYSTEM $VENDOR $RELEASE \033[01;34mmit die folgenden Merkmale:\n"
dlg011="\033[01;34m Name: \033[01;31m $NAME \033[01;34m \n Flavor: \033[01;31m $FLAVOR Bits \033[01;34m \n Kernel: \033[01;31m $KERNEL \033[01;34m \n "
dlg012=" Der G-WAN Installationsordner werden: \033[01;31m $HOME$GWANFOLDER \n \033[01;34mDie WSBT Installationsordner werden: \033[01;31m $HOME$WSBTFOLDER \n \033[01;34mDie TEMP-Ordner installieren werden: \033[01;31m $HOME$TMPINSTALL"
dlg013="Oops \033[01;34m Leider ist \033[01;31m $VENDOR $RELEASE \033[01;34mkann nicht mehr aktualisiert werden"
dlg014="Sie konnen jedoch mit \033[01;31m G-WAN \033[01;34mon \033[01;31m $VENDOR $RELEASE \033[01;34mbut Sie nicht"
dlg015="nutzen zu konnen, C++, C#, Java, Javascript Server-Seite, Lua, Objective C/C++, PHP,"
dlg016="Ruby oder Scala Servlets zu schaffen."
dlg017="In der Zwischenzeit, werden Sie noch in der Lage, ANSI C, ASM, GO, Perl und Python zu nutzen."
dlg018="Oops \033[01;34m Leider ist \033[01;31m $VENDOR $RELEASE \033[01;34mkann nicht voll mehr aktualisiert werden"
dlg019="So, \033[01;31m G-WAN \033[01;34mkann nicht Verwendung Scala mit \033[01;31m $VENDOR $RELEASE \033[01;34m"
dlg020="Sie konnen jedoch mit \033[01;31m G-WAN \033[01;34m auf \033[01;31m $VENDOR $RELEASE \033[01;34mmit ANSI C, ASM, C++, C#, Go "
dlg021="Java, Javascript Server-Seite, Lua, Objective C/C++, Perl, PHP, Python und Ruby"
dlg022="Servlets zu schaffen."
dlg023="Der erste Schritt ist zu definieren, wo das Skript G-WAN installiert werden soll"
dlg024="Mochten Sie den Installationsordner andern: j/N (leer return = Nein)? "
dlg025="So ist die neue G-WAN Installationsordner werden: \033[01;31m"
dlg026="und die neue WSBT Installationsordner werden: \033[01;31m"
dlg027="und die neue TEMP Ordner installieren werden: \033[01;31m"
dlg028="So ist die G-WAN install Ordner bleiben als: \033[01;31m"
dlg029="und die WSBT install Ordner bleiben als: \033[01;31m"
dlg030="und die TEMP-Ordner installieren bleiben als: \033[01;31m"
dlg031="So ist die G-WAN install Ordner bleiben als: \033[01;31m"
dlg032="und die WSBT install Ordner bleiben als: \033[01;31m"
dlg033="und die TEMP-Ordner installieren als bleiben: \033[01;31m"
dlg034="Das Installationsverzeichnis wurde nicht geandert."
dlg035="Der G-WAN Ordnernamen mussen bleiben: \033[01;31m $GWANFOLDER \033[01;34m"
dlg036="Bitte geben Sie nur eine neue \033[01;31mPATH \033[01;34mto Ort der G-WAN Installationsverzeichnis"
dlg037="dh \033[01;31m/opt \033[01;34moder \033[01;31m/home/Benutzername \033[01;34mdabei ist \033[01;31m'Benutzername' \033[01;34m der\033[01;31m Name \033[01;34mdes Benutzers"
dlg038="dieses Skript: \033[01;34m"
dlg039="Die neue Anlage wird Ordner: \033[01;31m"
dlg040="Bitte bestatigen Sie die anderung der install folder: j/N (leer return = Nein)? "
dlg041="Die Installation wurde nicht geandert."
dlg042="Das Installationsverzeichnis wurde nicht geandert."
dlg043="OK. Nun ist die Installation Weg wird sein: \033[01;31m"
dlg044="Wollen Sie, um fortzufahren: J/n (leer return = Ja)? "
dlg045="Sie beendet das Skript."
dlg046="Bitte starten Sie es mit einem richtigen Weg Wert. \nAuf Wiedersehen."
dlg047="OK. Fortsetzung der Installation ..."
dlg048="Der nachste Schritt ist die Auswahl und Installation von G-WAN sowie alle "
dlg049="benotigten Pakete und Abhangigkeiten, all die verschiedenen"
dlg050="Programmiersprachen fur G-WAN mit $VENDOR $RELEASE."
dlg051="Inzwischen bewusst sein, dass diese Installation kann bis zu 45 Minuten auf"
dlg052="die sehr lange Zeit, um Mono und nodejs installieren, wenn Sie sie auswahlen."
dlg053="Allerdings, hangt die Geschwindigkeit dieser Installation auch von der"
dlg054="Leistungsfahigkeit Ihres Rechners und Ihrer intrenet Bandbreite.\033[01;32m"
dlg055="Mochten Sie G-WAN installieren: J/n (leer return = Ja)? "
dlg056="Nichts wurde auf Ihrem System installiert ist."
dlg057="Auf Wiedersehen."
dlg058="G-WAN wird auf Ihrem System installiert sein."
dlg059="Bitte wahlen Sie nun die verschiedenen Sprachen, die Sie mit G-WAN zu nutzen."
dlg060="Nun, sagen Sie bitte, ob Sie gehen mit G-WAN nutzen mochten."
dlg061="Mochten Sie mit C++ G-WAN verwenden: J/n (leer return = Ja)? "
dlg062="C++ wird nicht fur G-WAN aktiviert werden."
dlg063="C++ installiert und aktiviert werden, fur G-WAN."
dlg064="Mochten Sie gehen mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg065="Go wird nicht fur G-WAN aktiviert werden."
dlg066="Go wird installiert und aktiviert fur G-WAN."
dlg067="Wenn Sie kein Java jetzt, werden Sie nicht in der Lage zu wahlen Scala."
dlg068="Mochten Sie Java mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg069="Java wird nicht fur G-WAN aktiviert werden."
dlg070="Java installiert und aktiviert werden, fur G-WAN."
dlg071="Mochten Sie Scala mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg072="Scala wird nicht fur G-WAN aktiviert werden."
dlg073="Scala wird installiert und aktiviert fur G-WAN."
dlg074="Wollen Sie LUA mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg075="Lua wird nicht fur G-WAN aktiviert werden."
dlg076="LUA wird installiert und aktiviert fur G-WAN."
dlg077="Mochten Sie Mono (C#) mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg078="Mono [C#) wird nicht fur G-WAN aktiviert werden."
dlg079="Mono [C#) wird installiert und aktiviert fur G-WAN."
dlg080="Mochten Sie nodejs (Javascript) mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg081="nodejs (Javascript) wird nicht fur G-WAN aktiviert werden."
dlg082="nodejs (Javascript) installiert und aktiviert werden, fur G-WAN."
dlg083="Wenn Sie nicht wahlen Objective C, werden Sie nicht in der Lage zu wahlen ObjC++"
dlg084="Mochten Sie Objective C mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg085="Objective C und Objective-C++ wird nicht fur G-WAN aktiviert werden."
dlg086="Objective C wird installiert und aktiviert fur G-WAN."
dlg087="Wenn Sie nicht wahlen Objective C++, werden Sie nicht in der Lage zu wahlen\nGnuStep."
dlg088="Mochten Sie Objective C++ mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg089="Objective C++ wird nicht fur G-WAN aktiviert werden."
dlg090="Objective C++ installiert und aktiviert werden, fur G-WAN."
dlg091="Mochten Sie GNU-Step mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg092="GNU-Step wird nicht fur G-WAN aktiviert werden."
dlg093="GNU-Step wird installiert und aktiviert fur G-WAN."
dlg094="Mochten Sie php5-cli mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg095="php5-cli wird nicht fur G-WAN aktiviert werden."
dlg096="php5-cli installiert und aktiviert werden, fur G-WAN."
dlg097="Mochten Sie Python mit G-WAN verwenden: J/n (leer return = Ja)? "
dlg098="Python wird nicht fur G-WAN aktiviert werden."
dlg099="Python installiert und aktiviert werden, fur G-WAN."
dlg100="Mochten Sie mit Rubin G-WAN verwenden: J/n (leer return = Ja)? "
dlg101="Ruby wird nicht fur G-WAN aktiviert werden."
dlg102="Ruby wird installiert und aktiviert fur G-WAN."
dlg103="Sie sind fast fertig mit den Fragen."
dlg104="Jetzt, zwei sehr interessante kleine Werkzeuge zu installieren."
dlg105="WEIGHTTP und CLWSBT sind 2 helle und moderne Benchmark-Tools specialy gemacht"
dlg106="zum jede Web-Server (einschliesslich, aber nicht beschränkt G-WAN) auf modernen"
dlg107="Systemen mit Multi-Core-CPUs (AMD und Intel) bei der Simulation zunehmende"
dlg108="hohe Belastungen."
dlg109="Mochten Sie WEIGHTTP und CLWSBT installieren: J/n (leer return = Ja)? "
dlg110="WEIGHTTP und CLWSBT erscheint nicht auf Ihrem System installiert sein."
dlg111="WEIGHTTP und CLWSBT wird auf Ihrem System installiert sein."
dlg112="Herunterladen G-WAN ..."
dlg113="Installieren G-WAN ..."
dlg114="Herunterladen und die Installation benotigten Dateien ..."
dlg115="Herunterladen von Paketen benotigt wird, um die Servlets verwenden..."
dlg116="Download und Installation der Go-Paket ..."
dlg117="Herunterladen der Mono (C#) Paket ..."
dlg118="Installieren von Mono (C#). Seien Sie geduldig, da dies kann bis zu 30 Minuten."
dlg119="Herunterladen der nodejs (Javascript) Paket ..."
dlg120="Installieren nodejs. Seien Sie geduldig, da dies kann bis zu 10 Minuten."
dlg121="Herunterladen und Installieren libev-dev und seine Abhangigkeiten ..."
dlg122="Herunterladen und Installieren libev ..."
dlg123="Herunterladen und Installieren WEIGHTTP ..."
dlg124="Herunterladen und Installieren CLWSBT ..."
dlg125="Es ist bereits eine Datei $FOLDER2/limits.conf.original"
dlg126="Wir wissen nicht uberschreiben die Sicherung."
dlg127="Kopieren $FOLDER2/limits.conf bis $FOLDER2/limits.conf.original"
dlg128="Kopieren $FOLDER2/limits.conf bis $TMPINSTALL/limits.conf.original"
dlg129="Es ist bereits eine Datei $FOLDER2/limits.conf.modified."
dlg130="So haben wir nicht uberschreiben oder modifizieren wir $FOLDER2/limits.conf."
dlg131="Kopieren $FOLDER2/limits.conf bis $TMPINSTALL/limits.conf.modified"
dlg132="andern $TMPINSTALL/limits.conf.modified"
dlg133="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER2/limits.conf"
dlg134="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER2/limits.conf.modified"
dlg135="Es ist bereits eine Datei $FOLDER1/sysctl.conf.original"
dlg136="Wir wissen nicht uberschreiben die Sicherung."
dlg137="Kopieren $FOLDER1/sysctl.conf bis $FOLDER1/sysctl.conf.original"
dlg138="copy $FOLDER1/sysctl.conf bis $TMPINSTALL/limits.conf.original"
dlg139="Es ist bereits eine Datei $FOLDER1/sysctl.conf.modified."
dlg140="So haben wir nicht uberschreiben oder modifizieren wir $FOLDER1/sysctl.conf."
dlg141="Kopieren $FOLDER1/sysctl.conf bis $TMPINSTALL/limits.conf.modified"
dlg142="andern $TMPINSTALL/limits.conf.modified"
dlg143="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/sysctl.conf"
dlg144="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/sysctl.conf.modified"
dlg145="Es ist bereits eine Datei $FOLDER1/sudoers.original"
dlg146="Wir wissen nicht uberschreiben die Sicherung."
dlg147="Kopieren $FOLDER1/sudoers bis $FOLDER1/sudoers.original"
dlg148="Kopieren $FOLDER1/sudoers bis $TMPINSTALL/limits.conf.original"
dlg149="Es ist bereits eine Datei $FOLDER1/sudoers.modified."
dlg150="So haben wir nicht uberschreiben oder modifizieren wir $FOLDER1/sudoers."
dlg151="Kopieren $FOLDER1/sudoers bis $TMPINSTALL/limits.conf.modified"
dlg152="andern $TMPINSTALL/limits.conf.modified"
dlg153="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/sudoers"
dlg154="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/sudoers.modified"
dlg155="Es ist bereits eine Datei $FOLDER1/login.defs.original"
dlg156="Wir wissen nicht uberschreiben die Sicherung."
dlg157="Kopieren $FOLDER1/login.defs bis $FOLDER1/login.defs.original"
dlg158="Kopieren $FOLDER1/login.defs bis $TMPINSTALL/limits.conf.original"
dlg159="Es ist bereits eine Datei $FOLDER1/login.defs.modified."
dlg160="So haben wir nicht uberschreiben oder modifizieren wir $FOLDER1/login.defs."
dlg161="Kopieren $FOLDER1/login.defs bis $TMPINSTALL/limits.conf.modified"
dlg162="andern $TMPINSTALL/limits.conf.modified"
dlg163="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/login.defs"
dlg164="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/login.defs.modified"
dlg165="Es ist bereits eine Datei $FOLDER1/environment.original"
dlg166="Wir wissen nicht uberschreiben die Sicherung."
dlg167="Kopieren $FOLDER1/environment bis $FOLDER1/environment.original"
dlg168="Kopieren $FOLDER1/environment bis $TMPINSTALL/limits.conf.original"
dlg169="Es ist bereits eine Datei $FOLDER1/environment.modified."
dlg170="So haben wir nicht uberschreiben oder modifizieren wir $FOLDER1/environment."
dlg171="Kopieren $FOLDER1/environment bis $TMPINSTALL/limits.conf.modified"
dlg172="andern $TMPINSTALL/limits.conf.modified"
dlg173="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/environment"
dlg174="Kopieren $TMPINSTALL/limits.conf.modified bis $FOLDER1/environment.modified"
dlg175="Am Ende der Installation wird empfohlen, um Ihr System zu \033[01;31maktualisieren,\033[01;34m"
dlg176="um die neueste feste Sicherheit zu bringen."
dlg177="Jedoch, abhangig von Ihrem \033[01;31mSoftware Sources \033[01;34m Einstellung\033[01;34m, die Aktualisierung Ihrer OS"
dlg178="kann beantragen einfugen Ihre Installations-CD (oder DVD oder USB-Stick)."
dlg179="Also, seien Sie vorbereitet."
dlg180="Wollen Sie Ihr Betriebssystem empfehlenswert zu aktualisieren: J/n (leer return = Ja)? "
dlg181="Suche nach Updates und installieren Sie sie, wenn uberhaupt."
dlg182="Das Skript wird nach Updates zu schauen Sicherheit am Ende der Installation."
dlg183="Am Ende des Skripts, wollen Sie die $TMPINSTALL Ordner zu halten, um zu "
dlg184="uberprufen war, wurde wahrend der Installation geschehen: J/n (leer return = Ja) ?"
dlg185="Wollen Sie Ihr Betriebssystem (sehr zu empfehlen) Neustart: J/n (leer return = Ja)? "
dlg186="Geniessen Sie G-WAN."
dlg187="Bitte lesen Sie die Datei G-WAN_Post-Install_READ-Me.txt"
dlg188="Geniessen Sie G-WAN und Spass haben mit WEIGHTTP und CLWSBT."
dlg189="Bitte lesen Sie die Dateien G-WAN_Post-Install_READ-Me.txt und WSBT_READ-Me.txt"
dlg190="Alles Gute."
dlg191="Ihr System wird in 1 Minute starten ..."
dlg192="Um den Neustart abzubrechen, drucken Sie Strg C"
dlg193="Alles Gute."
dlg194="Ihre Anpassung des G-WAN-Installation durchgefuhrt wird."
dlg195="Sind Sie bereit, um die ausgewahlten Pakete zu installieren: J/n (leer return = Ja)? "
dlg196="Sie haben nicht starten G-WAN-Installation. \nAuf Wiedersehen."
dlg197="Der G-WAN vollstandige Installation beginnt. Bitte gedulden ..."
dlg198="Hallo $ME.\n\nSie mussen lsb-release, um dieses Skript zu verwenden."
dlg199="Mochten Sie lsb-release jetzt installieren: J/n (leer retrun = Ja)? "
dlg200="Dieses Skript kann nicht ohne lsb-release fortzusetzen\n\n\033[01;34mBitte installieren lsb-release und starten Sie das Skript\nAuf Wiedersehen.\033[0m"
dlg201="Hello $ME.\n\nSie mussen installieren wget, um dieses Skript zu verwenden."
dlg202="Mochten Sie jetzt installieren wget: J/n (leer retrun = Ja)? "
dlg203="Dieses Skript kann nicht ohne wget fortzusetzen\n\n\033[01;34mBitte installieren wget (sudo yum install wget) und starten Sie\ndas Skript Auf Wiedersehen.\033[0m"
dlg204="\033[01;31mSorry, aber nach "
dlg205=" Versuchen, kann ich nicht downloaden "
dlg206="Mochten Sie sich jetzt wiederholen: j/N (leer return = Nein)? "
dlg207="\033[01;32mErneuter Versuch zu herunterzuladen \033[0m"
dlg208="\033[01;31mDieses Skript kann nicht fortsetzen ohne "
dlg209="\n\n\033[01;34mBitte uberprufen Sie Ihre Internetverbindung und starten\n Sie das Skript.\nAuf Wiedersehen.\033[0m"
dlg210="NOTIZ :"
dlg211="\033[01;31mSorry, aber nach "
dlg212=" Versuchen, kann ich nicht installieren "
dlg213="Mochten Sie sich jetzt wiederholen: j/N (leer return = Nein)? "
dlg214="033[01;32mErneuter Versuch zu installieren \033[0m"
dlg215="\033[01;31mDieses Skript kann nicht fortsetzen ohne "
dlg216="\n\n\033[01;34mBitte uberprufen Sie Ihre Internetverbindung und starten Sie das Skript.\nAuf Wiedersehen.\033[0m"
dlg217="Drei letzte Fragen..."
dlg218="Standardmassig ist G-WAN auf dem Port 8080 hort."
dlg219="Mochten Sie Port 80 statt 8080 verwenden: j/N (leer return = Nein)? "
dlg220="Die G-WAN-Listening-Port wird 80 sein."
dlg221="Die G-WAN-Listening-Port wird 8080 bleiben."
dlg222="Die $TMPINSTALL Ordner geloscht"
dlg223="Die $TMPINSTALL Ordner werden nicht geloscht"
}
# --------------------------------------------------------------------------------
#
# set the messages in french
#
set_language_fr()
{
dlgline="--------------------------------------------------------------------------------"
dlg001="Hello $ME.\n\nATTENTION :"
dlg002="Ce script ne peut pas se lancer sans les droits du compte root (sudo ou su)."
dlg003="Merci de relancer le script par la commande: \033[01;37msudo ./G-WAN_full-install-v2m.sh\\033[01;34m"
dlg004="ou d'utiliser le compte \033[01;31mroot\033[01;34m et de lancer: \033[01;37m./G-WAN_full-install-v2m.sh"
dlg005="Au revoir."
dlg006="Hello \033[01;31m$ME"
dlg007="Ce script installe \033[01;31mG-WAN\033[01;34m et tous les outils et dépendances nécessaires"
dlg008="pour utiliser les 15 langages de programmation déjà supportés en accord avec les"
dlg009="spécifications de votre OS."
dlg010="Votre OS est : \033[01;31m$SYSTEM $VENDOR $RELEASE \033[01;34mavec les caractéristiques suivantes :\n"
dlg011="\033[01;34m Nom: \033[01;31m$NAME\033[01;34m\n Flavor: \033[01;31m$FLAVOR bits\033[01;34m\n Noyau: \033[01;31m$KERNEL\033[01;34m\n"
dlg012=" Dossier d'installation de G-WAN : \033[01;31m$HOME$GWANFOLDER\n\033[01;34m Dossier d'installation de WSBT : \033[01;31m$HOME$WSBTFOLDER\n\033[01;34m Dossier d'installation temporaire: \033[01;31m$HOME$TMPINSTALL"
dlg013="Oops. \033[01;34mDésolé mais \033[01;31m$VENDOR $RELEASE\033[01;34m ne peut plus être mis à jour."
dlg014="Mais vous pouvez utiliser \033[01;31mG-WAN\033[01;34m avec \033[01;31m$VENDOR $RELEASE\033[01;34m sans"
dlg015="pouvoir utiliser C++, C#, Java, Javascript server side, Lua, Objective C/C++, PHP,"
dlg016="Ruby ou Scala pour créer des servlets."
dlg017="Mais vous pourrez toujours utiliser ANSI C, ASM, GO, Perl et Python."
dlg018="Oops. \033[01;34mDésolé mais \033[01;31m$VENDOR $RELEASE\033[01;34m ne peut plus être totalement mis à jour."
dlg019="Donc, \033[01;31mG-WAN\033[01;34m ne peut pas utiliser Scala avec \033[01;31m$VENDOR $RELEASE\033[01;34m."
dlg020="Mais vous pouvez utiliser \033[01;31mG-WAN\033[01;34m on \033[01;31m$VENDOR $RELEASE\033[01;34m avec ANSI C, ASM, C++, C#, Go,"
dlg021="Java, Javascript côté serveur, Lua, Objective C/C++, Perl, PHP, Python et Ruby"
dlg022="pour créer des servlets."
dlg023="La première étape est de définir où le script installera G-WAN."
dlg024="Voulez-vous changer le dossier d'installation : o/N (retour vide = Non)? "
dlg025="Donc, nouveau dossier pour G-WAN : \033[01;31m"
dlg026="et nouveau dossier pour WSBT : \033[01;31m"
dlg027="et nouveau dossier pour TEMP : \033[01;31m"
dlg028="Le dossier d'installation de G-WAN reste : \033[01;31m"
dlg029="le dossier d'instalation de WSBT reste : \033[01;31m"
dlg030="et le dossier d'installation TEMP reste : \033[01;31m"
dlg031="Le dossier d'installation de G-WAN reste : \033[01;31m"
dlg032="le dossier d'installation de WSBT reste : \033[01;31m"
dlg033="et le dossier d'installation TEMP reste : \033[01;31m"
dlg034="Le dossier d'installation n'a pas ete change."
dlg035="Le nom du dossier de G-WAN doit rester : \033[01;31m$GWANFOLDER\033[01;34m"
dlg036="Entrez seulement le \033[01;31mchemin\033[01;34m du \033[01;31mdossier\033[01;34m d'installation de G-WAN."
dlg037="Par exemple :\033[01;31m /opt \033[01;34mou aussi \033[01;31m/home/nom\033[01;34m ou\033[01;31m 'nom'\033[01;34m est le nom de l'utilisateur de"
dlg038="ce script : "
dlg039="Nouveau dossier d'installation : \033[01;31m"
dlg040="Confirmez-vous le nouveau dossier d'installation : o/N (retour vide = Non)? "
dlg041="Le chemin d'installation n'a pas été changé."
dlg042="Le dossier d'installation n'a pas été changé."
dlg043="Ok. Maintenant le chemin d'installation sera donc : \033[01;31m"
dlg044="Voulez-vous continuer : O/n (retour vide = Oui)? "
dlg045="Vous avez arrêté le script."
dlg046="Merci de le relancer avec un chemin d'installation valide.\nAu revoir."
dlg047="OK. Poursuite de l'installation..."
dlg048="L'étape suivante est de sélectionner et d'installer G-WAN et tous les paquets et"
dlg049="dépendances nécessaires pour utiliser les différents outils de programmmation"
dlg050="disponibles pour G-WAN sous $VENDOR $RELEASE."
dlg051="Soyez avertis que cette installation peut demander jusqu'a 45 minutes en raison"
dlg052="du temps nécessaire pour installer Mono et NodeJS (si vous les sélectionnez)."
dlg053="Cependant, le temps de cette installation dépend aussi de la puissance de votre"
dlg054="machine et de la vitesse de votre connexion internet.\033[01;32m"
dlg055="Voulez-vous installer G-WAN: O/n (retour vide = Oui)? "
dlg056="Rien n'a été installé sur votre système."
dlg057="Au revoir."
dlg058="G-WAN sera installé sur votre système."
dlg059="Veuillez sélectionner les outils que vous voulez utiliser avec G-WAN."
dlg060="Maintenant, merci de dire si vous voulez utiliser Go avec G-WAN."
dlg061="Voulez-vous utiliser C++ avec G-WAN: O/n (retour vide = Oui)? "
dlg062="C++ ne sera pas installé pour G-WAN"
dlg063="C++ sera installé pour G-WAN."
dlg064="Voulez-vous utiliser Go avec G-WAN: O/n (retour vide = Oui)? "
dlg065="Go ne sera pas installé pour G-WAN."
dlg066="Go sera installé pour G-WAN."
dlg067="Si vous ne sélectionnez pas Java, vous ne pourrez pas choisir Scala."
dlg068="Voulez-vous utiliser Java avec G-WAN: O/n (retour vide = Oui)? "
dlg069="Java et Scala ne seront pas installés pour G-WAN."
dlg070="Java sera installé pour G-WAN."
dlg071="Voulez-vous utiliser Scala avec G-WAN: O/n (retour vide = Oui)? "
dlg072="Scala ne sera pas installé pour G-WAN."
dlg073="Scala sera installé pour G-WAN."
dlg074="Voulez-vous utiliser LUA avec G-WAN: O/n (retour vide = Oui)? "
dlg075="Lua ne sera pas installé pour G-WAN"
dlg076="LUA sera installé pour G-WAN"
dlg077="Voulez-vous utiliser Mono (C#) avec G-WAN: O/n (retour vide = Oui)? "
dlg078="Mono (C#) ne sera pas installé pour G-WAN."
dlg079="Mono [C#) sera installé pour G-WAN."
dlg080="Voulez-vous utiliser NodeJS (Javascript) avec G-WAN: O/n (retour vide = Oui)? "
dlg081="Javascript (NodeJS) ne sera pas installé pour G-WAN"
dlg082="Javascript (NodeJS) sera installé pour G-WAN"
dlg083="Si vous ne sélectionnez pas Objective C, vous ne pourrez pas choisir Objc++."
dlg084="Voulez-vous utiliser Objective C avec G-WAN: O/n (retour vide = Oui)? "
dlg085="Objective C et Objective C++ ne seront pas installés pour G-WAN."
dlg086="Objective C sera installé pour G-WAN."
dlg087="Si vous ne sélectionnez pas Objective C++, vous ne pourrez pas choisir Gnu-Step."
dlg088="Voulez-vous utiliser Objective C++ avec G-WAN: O/n (retour vide = Oui)? "
dlg089="Objective C++ ne sera pas installé pour G-WAN."
dlg090="Objective C++ sera installé pour G-WAN."
dlg091="Voulez-vous utiliser GNU-Step avec G-WAN: O/n (retour vide = Oui)? "
dlg092="GNU-Step ne sera pas installé pour G-WAN."
dlg093="GNU-Step sera installé pour G-WAN."
dlg094="Voulez-vous utiliser PHP5-Cli avec G-WAN: O/n (retour vide = Oui)? "
dlg095="PHP5-Cli ne sera pas installé pour G-WAN."
dlg096="PHP5-Cli sera installé pour G-WAN."
dlg097="Voulez-vous utiliser Python avec G-WAN: O/n (retour vide = Oui)? "
dlg098="Python ne sera pas installé pour G-WAN."
dlg099="Python sera installé pour G-WAN."
dlg100="Voulez-vous utiliser Ruby avec G-WAN: O/n (retour vide = Oui)? "
dlg101="Ruby ne sera pas installé pour G-WAN."
dlg102="Ruby sera installé pour G-WAN."
dlg103="Vous en avez presque fini avec les questions."
dlg104="Maintenant, deux petits outils très intéressants à installer :"
dlg105="WEIGHTTP et CLWSBT sont 2 outils modernes de benchmark spécialement faits pour"
dlg106="stresser tout serveur web (donc non limité à G-WAN) exploité sur des machines"
dlg107="récentes utilisant des CPU multi cores (AMD and Intel) en simulant des montées"
dlg108="en charge croissantes."
dlg109="Voulez-vous installer WEIGHTTP et CLWSBT : O/n (retour vide = Oui)? "
dlg110="WEIGHTTP et CLWSBT ne seront pas installés sur votre système."
dlg111="WEIGHTTP et CLWSBT seront installés sur votre système."
dlg112="Téléchargement de G-WAN..."
dlg113="Installation de G-WAN..."
dlg114="Téléchargement et installation de fichiers complementaires..."
dlg115="Téléchargement des paquets pour utiliser les servlets..."
dlg116="Téléchargement et installation du package Go..."
dlg117="Téléchargement du package Mono (C#)..."
dlg118="Installation de Mono (C#). Soyez patient car cela peut durer 30 minutes."
dlg119="Téléchargement du package the NodeJS (Javascript)..."
dlg120="Installation de NodeJS. Soyez patient car cela peut durer 10 minutes."
dlg121="Téléchargement et installation de libev-dev et de ses dépendances..."
dlg122="Téléchargement et installation de libev..."
dlg123="Téléchargement et installation de WEIGHTTP..."
dlg124="Téléchargement et installation de CLWSBT..."
dlg125="Il y a déjà un fichier $FOLDER2/limits.conf.original"
dlg126="Nous n'écrasons pas la sauvegarde précédente."
dlg127="Sauvegarde de $FOLDER2/limits.conf dans $FOLDER2/limits.conf.original"
dlg128="Copie $FOLDER2/limits.conf dans $TMPINSTALL/limits.conf.original"
dlg129="Il y a déjà un fichier $FOLDER2/limits.conf.modified."
dlg130="Nous n'écrasons pas ni ne modifions $FOLDER2/limits.conf."
dlg131="Copie $FOLDER2/limits.conf dans $TMPINSTALL/limits.conf.modified"
dlg132="Modification de $TMPINSTALL/limits.conf.modified"
dlg133="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER2/limits.conf"
dlg134="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER2/limits.conf.modified"
dlg135="Il y a déjà un fichier $FOLDER1/sysctl.conf.original"
dlg136="Nous n'écrasons pas la sauvegarde précédente."
dlg137="Sauvegarde de $FOLDER1/sysctl.conf dans $FOLDER1/sysctl.conf.original"
dlg138="Copie $FOLDER1/sysctl.conf dans $TMPINSTALL/limits.conf.original"
dlg139="Il y a déjà un fichier $FOLDER1/sysctl.conf.modified."
dlg140="Nous n'écrasons pas ni ne modifions $FOLDER1/sysctl.conf."
dlg141="Copie $FOLDER1/sysctl.conf dans $TMPINSTALL/limits.conf.modified"
dlg142="Modification de $TMPINSTALL/limits.conf.modified"
dlg143="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/sysctl.conf"
dlg144="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/sysctl.conf.modified"
dlg145="Il y a déjà un fichier $FOLDER1/sudoers.original"
dlg146="Nous n'écrasons pas la sauvegarde précédente."
dlg147="Sauvegarde de $FOLDER1/sudoers dans $FOLDER1/sudoers.original"
dlg148="Copie $FOLDER1/sudoers dans $TMPINSTALL/limits.conf.original"
dlg149="Il y a déjà un fichier $FOLDER1/sudoers.modified."
dlg150="Nous n'écrasons pas ni ne modifions $FOLDER1/sudoers."
dlg151="Copie $FOLDER1/sudoers dans $TMPINSTALL/limits.conf.modified"
dlg152="Modification de $TMPINSTALL/limits.conf.modified"
dlg153="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/sudoers"
dlg154="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/sudoers.modified"
dlg155="Il y a déjà un fichier $FOLDER1/login.defs.original"
dlg156="Nous n'écrasons pas la sauvegarde précédente."
dlg157="Sauvegarde de $FOLDER1/login.defs dans $FOLDER1/login.defs.original"
dlg158="Copie $FOLDER1/login.defs dans $TMPINSTALL/limits.conf.original"
dlg159="Il y a déjà un fichier $FOLDER1/login.defs.modified."
dlg160="Nous n'écrasons pas ni ne modifions $FOLDER1/login.defs."
dlg161="Copie $FOLDER1/login.defs dans $TMPINSTALL/limits.conf.modified"
dlg162="Modification de $TMPINSTALL/limits.conf.modified"
dlg163="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/login.defs"
dlg164="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/login.defs.modified"
dlg165="Il y a déjà un fichier $FOLDER1/environment.original"
dlg166="Nous n'écrasons pas la sauvegarde précédente."
dlg167="Sauvegarde de $FOLDER1/environment dans $FOLDER1/environment.original"
dlg168="Copie $FOLDER1/environment dans $TMPINSTALL/limits.conf.original"
dlg169="Il y a déjà un fichier $FOLDER1/environment.modified."
dlg170="Nous n'écrasons pas ni ne modifions $FOLDER1/environment."
dlg171="Copie $FOLDER1/environment dans $TMPINSTALL/limits.conf.modified"
dlg172="Modification de $TMPINSTALL/limits.conf.modified"
dlg173="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/environment"
dlg174="Copie $TMPINSTALL/limits.conf.modified dans $FOLDER1/environment.modified"
dlg175="A la fin de l'installation il est conseillé de \033[01;31mmettre à jour\033[01;34m votre OS"
dlg176="pour obtenir les derniers fixes de sécurité."
dlg177="En regard de vos réglages des \033[01;31mSources Logiciels\033[01;34m mettre à jour"
dlg178="votre OS peut demander d'introduire votre CD (DVD ou clef USB) d'installation."
dlg179="Aussi, merci de vous préparer à cette éventualité."
dlg180="Voulez-vous mettre à jour votre OS (très recommandé): O/n (retour vide = Oui)? "
dlg181="Votre système ne sera pas mis à jour à la fin du script."
dlg182="Le script cherchera les mises à jour de sécurité à la fin de l'installation."
dlg183="A la fin du script, voulez-vous garder le dossier $TMPINSTALL pour"
dlg184="vérifier ce qui a été installé : O/n (retour vide = Oui)? "
dlg185="Voulez-vous redémarrer votre OS (très recommandé): O/n (retour vide = Oui)? "
dlg186="Appreciez G-WAN."
dlg187="Merci de lire le fichier G-WAN_Post-Install_READ-ME.txt"
dlg188="Appreciez G-WAN et faites vous plaisir avec WEIGHTTP et CLWSBT."
dlg189="Merci de lire les fichiers G-WAN_Post-Install_READ-ME.txt et WSBT_READ-ME.txt"
dlg190="Rien que le meilleur pour vous."
dlg191="Votre système va redémarrer dans 1 minute..."
dlg192="Pour annuler le redémarrage, appuyez sur Ctrl C."
dlg193="Rien que le meilleur pour vous."
dlg194="La customisation de l'installation de G-WAN est terminée."
dlg195="Etes-vous prêt à installer les paquets sélectionnés: O/n (retour vide = Oui)? "
dlg196="You n'avez pas lancé l'installation de G-WAN.\nAu revoir."
dlg197="L'installation complète de G-WAN commence. Merci d'être patient..."
dlg198="Hello $ME.\n\nVous devez installer lsb-release pour utiliser ce script."
dlg199="Voulez-vous installer lsb-release maintenant : O/n (retour vide = Oui)? "
dlg200="Ce script ne peut pas continuer sans lsb-release.\n\n\033[01;34mMerci d'installer lsb-release et de relancer le script.\nAu revoir."
dlg201="Hello $ME.\n\nVous devez installer wget pour utiliser ce script."
dlg202="Voulez-vous installer wget maintenant : O/n (retour vide = Oui)? "
dlg203="Ce script ne peut pas continuer sans wget.\n\n\033[01;34mMerci d'installer wget (sudo yum -y install wget) et de relancer le script.\nAu revoir."
dlg204="\033[01;31mDésolé mais après "
dlg205=" tentatives, je ne peux pas obtenir "
dlg206="Voulez-vous recommencer maintenant : o/N (retour vide = Non)? "
dlg207="\033[01;32mNouvel essai de téléchargement de \033[0m"
dlg208="\033[01;31mCe script ne peut pas continuer sans "
dlg209="\n\n\033[01;34mMerci de vérifier votre connexion internet et de relancer\nle script.\nAu revoir.\033[0m"
dlg210="NOTE :"
dlg211="\033[01;31mDésolé mais après "
dlg212=" tentatives, impossible d'installer "
dlg213="Voulez-vous recommencer maintenant : o/N (retour vide = Non)? : "
dlg214="033[01;32mNouvel essai d'installation de \033[0m"
dlg215="\033[01;31mCe script ne peut pas continuer sans "
dlg216="\n\n\033[01;34mMerci de vérifier votre connexion internet et de relancer\nle script.\nAu revoir.\033[0m"
dlg217="Trois dernières questions..."
dlg218="Par défaut, G-WAN écoute sur le port 8080."
dlg219="Voulez-vous utiliser le port 80 au lieu du port 8080: o/N (retour vide = Non)? "
dlg220="Le port utilisé par G-WAN sera le port 80."
dlg221="Le port utilisé par G-WAN restera 8080."
dlg222="Le dossier $TMPINSTALL sera supprimé."
dlg223="le dossier $TMPINSTALL ne sera pas supprimé."
}
# --------------------------------------------------------------------------------
#
# set the messages in english
#
set_language_us()
{
dlgline="--------------------------------------------------------------------------------"
dlg001="WARNING:"
dlg002="This script can't be launched without the root privileges (i.e. sudo or su)."
dlg003="Please restart the script with the command: \033[01;37msudo ./G-WAN_full-install-v2m.sh\033[01;34m"
dlg004="or use the\033[01;31m root \033[01;34maccount and start: \033[01;37m./G-WAN_full-install-v2m.sh"
dlg005="Goodbye."
dlg006="Hello \033[01;31m$ME"
dlg007="This script installs\033[01;31m G-WAN \033[01;34mas well as all the necessary tools & dependencies"
dlg008="needed to play with the 15 programming languages already supported accordingly"
dlg009="to your OS specifications."
dlg010="Your OS is:\033[01;31m $SYSTEM $VENDOR $RELEASE \033[01;34mwith the following characteristics:\n"
dlg011="\033[01;34m Name: \033[01;31m $NAME\033[01;34m\n Flavor: \033[01;31m $FLAVOR bits\033[01;34m\n Kernel: \033[01;31m $KERNEL\033[01;34m\n"
dlg012=" The G-WAN install folder will be:\033[01;31m $HOME$GWANFOLDER\n\033[01;34m The WSBT install folder will be: \033[01;31m $HOME$WSBTFOLDER\n\033[01;34m The TEMP install folder will be: \033[01;31m $HOME$TMPINSTALL"
dlg013="Oops.\033[01;34m We're sorry but\033[01;31m $VENDOR $RELEASE \033[01;34mcan't be updated anymore."
dlg014="However, you can use\033[01;31m G-WAN \033[01;34mon\033[01;31m $VENDOR $RELEASE \033[01;34mbut you won't"
dlg015="be able to use C++, C#, Java, Javascript server side, Lua, Objective C/C++, PHP,"
dlg016="Ruby or Scala to create servlets."
dlg017="Meanwhile, you still will be able to use ANSI C, ASM, GO, Perl and Python."
dlg018="Oops.\033[01;34m We're sorry but\033[01;31m $VENDOR $RELEASE \033[01;34mcan't be fully updated anymore."
dlg019="So,\033[01;31m G-WAN \033[01;34mcan't use Scala with\033[01;31m $VENDOR $RELEASE\033[01;34m."
dlg020="However, you can use\033[01;31m G-WAN \033[01;34m on\033[01;31m $VENDOR $RELEASE \033[01;34mwith ANSI C, ASM, C++, C#, Go,"
dlg021="Java, Javascript server side, Lua, Objective C/C++, Perl, PHP, Python and Ruby"
dlg022="to create servlets."
dlg023="The first step is to define where the script will install G-WAN."
dlg024="Do you want to change the install folder: y/N (empty return = No)? "
dlg025="So the new G-WAN install folder will be: \033[01;31m"
dlg026="and the new WSBT install folder will be: \033[01;31m"
dlg027="and the new TEMP install folder will be: \033[01;31m"
dlg028="So the G-WAN install folder will stay as: \033[01;31m"
dlg029="and the WSBT install folder will stay as: \033[01;31m"
dlg030="and the TEMP install folder will stay as: \033[01;31m"
dlg031="So the G-WAN install folder will stay as: \033[01;31m"
dlg032="and the WSBT install folder will stay as: \033[01;31m"
dlg033="and the TEMP install folder will stay as: \033[01;31m"
dlg034="The installation folder wasn't changed."
dlg035="The G-WAN folder name must stay:\033[01;31m $GWANFOLDER\033[01;34m"
dlg036="Please enter only a new\033[01;31m PATH \033[01;34mto place the G-WAN installation folder"
dlg037="i.e.\033[01;31m /opt \033[01;34mor\033[01;31m /home/user_name \033[01;34mwhere\033[01;31m 'user_name' \033[01;34mis the\033[01;31m name \033[01;34mof the user of"
dlg038="this script: \033[01;34m"
dlg039="The new installation folder will be:\033[01;31m "
dlg040="Please confirm changing the install folder: y/N (empty return = No)? "
dlg041="The installation path wasn't changed."
dlg042="The installation folder wasn't changed."
dlg043="OK. Now the installation path will be:\033[01;31m "
dlg044="Do you want to continue: Y/n (empty return = Yes)? "
dlg045="You ended the script."
dlg046="Please restart it with a right path value.\nGoodbye."
dlg047="OK. Continuing the installation..."
dlg048="The next step is to select and install G-WAN as well as all the needed"
dlg049="packages and dependencies to use all the different programming languages"
dlg050="available for G-WAN with $VENDOR $RELEASE."
dlg051="Meanwhile, be aware that this install can last up to 45 minutes due to the"
dlg052="very long time to install Mono and NodeJS, if you select them."
dlg053="BTW, The speed of this installation depends also of the power of your machine"
dlg054="and of your intrenet bandwith.\033[01;32m"
dlg055="Do you want to install G-WAN: Y/n (empty return = Yes)? "
dlg056="Nothing was installed on your system."
dlg057="Goodbye."
dlg058="G-WAN will be installed on your system."
dlg059="Now, please select the different languages you wish to use with G-WAN."
dlg060="Now, please say if you wish to use Go with G-WAN."
dlg061="Do you wish to use C++ with G-WAN: Y/n (empty return = Yes)? "
dlg062="C++ will not be enabled for G-WAN."
dlg063="C++ will be installed and enabled for G-WAN."
dlg064="Do you wish to use Go with G-WAN: Y/n (empty return = Yes)? "
dlg065="Go will not be enabled for G-WAN."
dlg066="Go will be installed and enabled for G-WAN."
dlg067="If you don't select Java now, you'll not be able to select Scala."
dlg068="Do you wish to use Java with G-WAN: Y/n (empty return = Yes)? "
dlg069="Java will not be enabled for G-WAN."
dlg070="Java will be installed and enabled for G-WAN."
dlg071="Do you wish to use Scala with G-WAN: Y/n (empty return = Yes)? "
dlg072="Scala will not be enabled for G-WAN."
dlg073="Scala will be installed and enabled for G-WAN."
dlg074="Do you wish to use LUA with G-WAN: Y/n (empty return = Yes)? "
dlg075="Lua will not be enabled for G-WAN."
dlg076="LUA will be installed and enabled for G-WAN."
dlg077="Do you wish to use Mono (C#) with G-WAN: Y/n (empty return = Yes)? "
dlg078="Mono [C#) will not be enabled for G-WAN."
dlg079="Mono [C#) will be installed and enabled for G-WAN."
dlg080="Do you wish to use NodeJS (Javascript) with G-WAN: Y/n (empty return = Yes)? "
dlg081="NodeJS (Javascript) will not be enabled for G-WAN."
dlg082="NodeJS (Javascript) will be installed and enabled for G-WAN."
dlg083="If you don't select Objective C, you'll not be able to select Objc++."
dlg084="Do you wish to use Objective C with G-WAN: Y/n (empty return = Yes)? "
dlg085="Objective C and Objective C++ will not be enabled for G-WAN."
dlg086="Objective C will be installed and enabled for G-WAN."
dlg087="If you don't select Objective C++, you'll not be able to select Gnu-Step."
dlg088="Do you wish to use Objective C++ with G-WAN: Y/n (empty return = Yes)? "
dlg089="Objective C++ will not be enabled for G-WAN."
dlg090="Objective C++ will be installed and enabled for G-WAN."
dlg091="Do you wish to use GNU-Step with G-WAN: Y/n (empty return = Yes)? "
dlg092="GNU-Step will not be enabled for G-WAN."
dlg093="GNU-Step will be installed and enabled for G-WAN."
dlg094="Do you wish to use PHP5-Cli with G-WAN: Y/n (empty return = Yes)? "
dlg095="PHP5-Cli will not be enabled for G-WAN."
dlg096="PHP5-Cli will be installed and enabled for G-WAN."
dlg097="Do you wish to use Python with G-WAN: Y/n (empty return = Yes)? "
dlg098="Python will not be enabled for G-WAN."
dlg099="Python will be installed and enabled for G-WAN."
dlg100="Do you wish to use Ruby with G-WAN: Y/n (empty return = Yes)? "
dlg101="Ruby will not be enabled for G-WAN."
dlg102="Ruby will be installed and enabled for G-WAN."
dlg103="You're almost done with the questions."
dlg104="Now, two very interesting little tools to install:"
dlg105="WEIGHTTP and CLWSBT are 2 light and modern benchmark tools specialy made"
dlg106="to stress any web server (including but not limited to G-WAN) hosted on"
dlg107="modern systems using multi core CPUs (AMD and Intel) when simulating"
dlg108="increasing high loads."
dlg109="Do you want to install WEIGHTTP and CLWSBT: Y/n (empty return = Yes)? "
dlg110="WEIGHTTP and CLWSBT will not be installed on your system."
dlg111="WEIGHTTP and CLWSBT will be installed on your system."
dlg112="Downloading G-WAN..."
dlg113="Installing G-WAN..."
dlg114="Downloading and installing other needed files..."
dlg115="Downloading packages needed to use the servlets..."
dlg116="Downloading and installing the Go package..."
dlg117="Downloading the Mono (C#) package..."
dlg118="Installing Mono (C#). Be patient since this can take up to 30 minutes."
dlg119="Downloading the NodeJS (Javascript) package..."
dlg120="Installing NodeJS. Be patient since this can take up to 10 minutes."
dlg121="Downloading and installing libev-dev and its dependencies..."
dlg122="Downloading and installing libev..."
dlg123="Downloading and installing WEIGHTTP..."
dlg124="Downloading and installing CLWSBT..."
dlg125="There is already a file $FOLDER2/limits.conf.original"
dlg126="We don't overwrite the backup."
dlg127="Copy $FOLDER2/limits.conf to $FOLDER2/limits.conf.original"
dlg128="Copy $FOLDER2/limits.conf to $TMPINSTALL/limits.conf.original"
dlg129="There is already a file $FOLDER2/limits.conf.modified."
dlg130="So we don't overwrite it nor we modify $FOLDER2/limits.conf."
dlg131="Copy $FOLDER2/limits.conf to $TMPINSTALL/limits.conf.modified"
dlg132="Modify $TMPINSTALL/limits.conf.modified"
dlg133="Copy $TMPINSTALL/limits.conf.modified to $FOLDER2/limits.conf"
dlg134="Copy $TMPINSTALL/limits.conf.modified to $FOLDER2/limits.conf.modified"
dlg135="There is already a file $FOLDER1/sysctl.conf.original"
dlg136="We don't overwrite the backup."
dlg137="Copy $FOLDER1/sysctl.conf to $FOLDER1/sysctl.conf.original"
dlg138="copy $FOLDER1/sysctl.conf to $TMPINSTALL/limits.conf.original"
dlg139="There is already a file $FOLDER1/sysctl.conf.modified."
dlg140="So we don't overwrite it nor we modify $FOLDER1/sysctl.conf."
dlg141="Copy $FOLDER1/sysctl.conf to $TMPINSTALL/limits.conf.modified"
dlg142="Modify $TMPINSTALL/limits.conf.modified"
dlg143="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/sysctl.conf"
dlg144="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/sysctl.conf.modified"
dlg145="There is already a file $FOLDER1/sudoers.original"
dlg146="We don't overwrite the backup."
dlg147="Copy $FOLDER1/sudoers to $FOLDER1/sudoers.original"
dlg148="Copy $FOLDER1/sudoers to $TMPINSTALL/limits.conf.original"
dlg149="There is already a file $FOLDER1/sudoers.modified."
dlg150="So we don't overwrite it nor we modify $FOLDER1/sudoers."
dlg151="Copy $FOLDER1/sudoers to $TMPINSTALL/limits.conf.modified"
dlg152="Modify $TMPINSTALL/limits.conf.modified"
dlg153="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/sudoers"
dlg154="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/sudoers.modified"
dlg155="There is already a file $FOLDER1/login.defs.original"
dlg156="We don't overwrite the backup."
dlg157="Copy $FOLDER1/login.defs to $FOLDER1/login.defs.original"
dlg158="Copy $FOLDER1/login.defs to $TMPINSTALL/limits.conf.original"
dlg159="There is already a file $FOLDER1/login.defs.modified."
dlg160="So we don't overwrite it nor we modify $FOLDER1/login.defs."
dlg161="Copy $FOLDER1/login.defs to $TMPINSTALL/limits.conf.modified"
dlg162="Modify $TMPINSTALL/limits.conf.modified"
dlg163="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/login.defs"
dlg164="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/login.defs.modified"
dlg165="There is already a file $FOLDER1/environment.original"
dlg166="We don't overwrite the backup."
dlg167="Copy $FOLDER1/environment to $FOLDER1/environment.original"
dlg168="Copy $FOLDER1/environment to $TMPINSTALL/limits.conf.original"
dlg169="There is already a file $FOLDER1/environment.modified."
dlg170="So we don't overwrite it nor we modify $FOLDER1/environment."
dlg171="Copy $FOLDER1/environment to $TMPINSTALL/limits.conf.modified"
dlg172="Modify $TMPINSTALL/limits.conf.modified"
dlg173="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/environment"
dlg174="Copy $TMPINSTALL/limits.conf.modified to $FOLDER1/environment.modified"
dlg175="At the end of the installation, it is recommended to \033[01;31mupdate\033[01;34m your system to get"
dlg176="the latest security fixes."
dlg177="However depending of your \033[01;31mSoftware Sources\033[01;34m setting, updating your OS may request"
dlg178="to insert your install CD (or DVD or USB stick)."
dlg179="So, please be prepared."
dlg180="Do you want to update your OS (highly recommended): Y/n (empty return = Yes)? "
dlg181="Your system will not be updated at the end of the script."
dlg182="The script will look for security updates at the end of the install."
dlg183="At the end of the script, do you want to keep the $TMPINSTALL folder to"
dlg184="check was was done during the installation: Y/n (empty return = Yes)? "
dlg185="Do you want to reboot your OS (highly recommended): Y/n (empty return = Yes)? "
dlg186="Enjoy G-WAN."
dlg187="Please read the file G-WAN_Post-Install_READ-ME.txt"
dlg188="Enjoy G-WAN and have fun using WEIGHTTP and CLWSBT."
dlg189="Please read the files G-WAN_Post-Install_READ-ME.txt and WSBT_READ-ME.txt"
dlg190="All the best."
dlg191="Your system will restart in 1 minute..."
dlg192="To cancel the reboot, press Ctrl C."
dlg193="All the best."
dlg194="Your customisation of the G-WAN install is done."
dlg195="Are you ready to install the selected packages: Y/n (empty return = Yes)? "
dlg196="You didn't start the G-WAN installation.\nGoodbye."
dlg197="The G-WAN full installation starts. Please be patient..."
dlg198="Hello $ME.\n\nYou must install lsb-release to use this script."
dlg199="Do you want to install lsb-release now: Y/n (empty retrun = Yes)? "
dlg200="This script can't continue without lsb-release.\n\n\033[01;34mPlease install lsb-release and restart \nthe script.\nGoodbye.\033[0m"
dlg201="Hello $ME.\n\nYou must install wget to use this script."
dlg202="Do you want to install wget now: Y/n (empty retrun = Yes)? "
dlg203="This script can't continue without wget.\n\n\033[01;34mPlease install wget (sudo yum install wget) and restart \nthe script.\nGoodbye.\033[0m"
dlg204="\033[01;31mSorry but after "
dlg205=" tries, I can't download "
dlg206="Do you wish to retry right now: y/N (empty return = No)? "
dlg207="\033[01;32mRetrying to download \033[0m"
dlg208="\033[01;31mThis script can't continue without "
dlg209="\n\n\033[01;34mPlease verify your internet connection and restart\nthe script.\nGoodbye.\033[0m"
dlg210="NOTE:"
dlg211="\033[01;31mSorry but after "
dlg212=" tries, I can't install "
dlg213="Do you wish to retry right now: y/N (empty return = No)? "
dlg214="\033[01;32mRetrying to install \033[0m"
dlg215="\033[01;31mThis script can't continue without "
dlg216="\n\n\033[01;34mPlease verify your internet connection and restart the script.\nGoodbye.\033[0m"
dlg217="Three last questions..."
dlg218="By default, G-WAN is listening on the port 8080."
dlg219="Do you want to use the port 80 Vs. 8080: y/N (empty return = No)? "
dlg220="The G-WAN listening port will be 80."
dlg221="The G-WAN listening port will stay 8080."
dlg222="The $TMPINSTALL folder will be deleted."
dlg223="The $TMPINSTALL folder will not be deleted."
}
# --------------------------------------------------------------------------------
#
# Special function to secure the use of wget (due to Fedora, Red Hat and CentOS problems)
#
get_file()
{
TRYCOUNT="0"
until wget -O $DESTINSTALL"/"$FILE $SOURCE$FILE
do
TRYCOUNT=$((TRYCOUNT+1))
if [ $TRYCOUNT = 99 ]
then
PS1=$RED
$ECHO "${PS1}"
# dlg204="Sorry but after "
# dlg205=" tries, I can't download "
$ECHO "$dlg204$TRYCOUNT$dlg205$SOURCE$FILE"
PS1=$YELLOW
$ECHO "${PS1}"
# dlg206="Do you wish to retry right now: y/N (empty return = No) ? : "
read -p "$dlg206" DOITAGAIN
case $DOITAGAIN in
'Y'|'y'|'O'|'o'|'J'|'j'|'S'|'s')
# dlg207="Retrying to download "
SOURCE="http://www.as2.com/linux/tools/";$ECHO "$dlg207"$SOURCE$FILE; get_file;;
*)
# dlg208="This script can't continue without "
# dlg209="\n\n\033[01;34mPlease verify your internet connection and restart the script.\nGoodbye.\033[0m"
PS1=$RED; $ECHO "${PS1}"; $ECHO "$dlg208"$FILE"$dlg209"; exit;;
esac
fi
done
}
# --------------------------------------------------------------------------------
#
# Special function to secure the use of yum (only with Fedora, Red Hat and CentOS)
#
get_packet()
{
TRYGET="0"
until $DISTRO_INSTALL$PACKET
do
TRYGET=$((TRYGET+1))
if [ $TRYGET = 99 ]
then
# dlg211="Sorry but after "
# dlg212=" tries, I can't install "
PS1=$RED
$ECHO "${PS1}"
# dlg204="Sorry but after "
$ECHO "$dlg211"$TRYGET"$dlg212"$PACKET
PS1=$YELLOW
$ECHO "${PS1}"
# dlg213="Do you wish to retry right now: y/N (empty return = No) ? : "
read -p "$dlg213" TRYAGAIN
case $TRYAGAIN in
'Y'|'y'|'O'|'o'|'J'|'j'|'S'|'s')
# dlg214="Retrying to install"
$ECHO "$dlg214"$PACKET; get_packet;;
*)
# dlg215="This script can't continue without "
# dlg216="\n\nPlease verify your internet connection and restart the script.\nGoodbye."
PS1=$RED; $ECHO "${PS1}"; $ECHO "$dlg215"$PACKET"$dlg216"; exit;;
esac
fi
done
}
# --------------------------------------------------------------------------------
#
# check if lsb_release and wget are installed.
#
check_basepack()
{
lsb=$(whereis lsb_release)
if [ "$lsb" = "lsb_release:" ]; then
PS1=$RED
$ECHO "${PS1}"
#dlg198="You must install lsb-release to use this script."
$ECHO "$dlg198"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg199="Do you want to install lsb-release now: Y/n (empty retrun = Yes) ? "
read -p "$dlg199" LSBRELEASE
case $LSBRELEASE in
'N'|'n')
# dlg200="This script can't continue without lsb-release.\nPlease install lsb-release and restart the script.\nGoodbye."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg200"; PS1=$BACK; $ECHO "${PS1}"; exit;;
*)
PS1=$BACK; $ECHO "${PS1}"; PACKET="redhat-lsb-core"; get_packet;;
esac
fi
WGET=$(whereis wget)
if [ "$WGET" = "wget:" ]; then
PS1=$RED
$ECHO "${PS1}"
#dlg201="You must install wget to use this script."
$ECHO "$dlg201"
PS1=$YELLOW
$ECHO "${PS1}"
#dlg202="Do you want to install wget now: Y/n (empty retrun = Yes) ? "
read -p "$dlg202" GETWGET
case $GETWGET in
'N'|'n')
# dlg203="This script can't continue without wget.\nPlease install wget and restart the script.\nGoodbye."
PS1=$GREEN; $ECHO "${PS1}"; $ECHO "$dlg203"; PS1=$BACK; $ECHO "${PS1}"; exit;;
*)
PS1=$BACK; $ECHO "${PS1}"; PACKET="wget"; get_packet;;
esac
fi
}
# --------------------------------------------------------------------------------
#
# get the installed language and set the messages accordingly.
#
get_tongue()
{
TONGUE=$($ECHO $LANG | cut -c1,2)
case $TONGUE in
'de')
set_language_de;;
'es')
set_language_es;;
'fr')
set_language_fr;;
*)
set_language_us;;
esac
}
# --------------------------------------------------------------------------------
#
# get the OS vendor name
#
get_osname()
{
if [ -e /etc/arch-release ]
then
VENDOR="Arch"
elif [ -e /etc/fedora-release ]
then
VENDOR="Fedora"
elif [ -e /etc/centos-release ]
then
VENDOR="CentOS"
elif [ -e /etc/redhat-release ]
then
VENDOR="Red Hat"
elif [ "$VENDOR" = "" ]
then
VENDOR=$(lsb_release -si)
fi
if [ "$VENDOR" = "LinuxMint" ]
then
VENDOR="Mint"
fi
if [ "$VENDOR" = "ManjaroLinux" ]
then
VENDOR="Manjaro"
fi
if [ "$VENDOR" = "arch" ]
then
VENDOR="Arch"
fi
}
# --------------------------------------------------------------------------------
#
# set the variables used in this script
#
set_variables()
{
#
# assign prompt colors
#
RED="\033[01;31m"
GREEN="\033[01;32m"
YELLOW="\033[01;33m"
BLUE="\033[01;34m"
PINK="\033[01;35m"
CIAN="\033[01;36m"
WHITE="\033[01;37m"
BACK="\033[0m"
#
# get the distribution flavor (i.e. 32 bit or 64 bit)
#
FLAVOR=$(getconf LONG_BIT)
#
# define system file folders
#
FOLDER1="/etc"
FOLDER2="/etc/security"
GWANFOLDER="/gwan_linux$FLAVOR-bit"
WSBTFOLDER="/wsbt"
TMPINSTALL="/tmp_install$FLAVOR-bit"
#
# get the user name
#
ME=$USER
#
# get the OS type
#
SYSTEM=$(uname)
#
# get the OS vendor name
#
get_osname
#
# set the $ECHO command for the different sh or bash
#
if [ "$VENDOR" = "Debian" ] || [ "$VENDOR" = "Mint" ] || [ "$VENDOR" = "Ubuntu" ]
then
ECHO="echo "
else
ECHO="echo -e "
fi
#
# get the installed language to set the messages accordingly.
#
get_tongue
#
# check if the script was started with root priviledges
#
check_root
#
# check if the lsb_release and wget packages are installed
#
check_basepack
#
# get the distribution name
#
NAME=$(lsb_release -sc)
#
# get the release number (e.g. 12.04)
#
RELEASE=$(lsb_release -sr)
#
# get the kernel number
#
KERNEL=$(uname -r)
#
# define the system command to download and install the packages accordingly to the distros
#
case $VENDOR in
'Debian'|'Ubuntu'|'Mint')
DISTRO_UPDATE="apt-get -y update"; DISTRO_UPGRADE="apt-get -y dist-upgrade"; DISTRO_GET="apt-get -y "; DISTRO_INSTALL="apt-get -y install ";;
'Fedora'|'Red Hat'|'CentOS')
DISTRO_UPDATE="yum -y update"; DISTRO_UPGRADE="yum -y upgrade"; DISTRO_GET="yum "; DISTRO_INSTALL="yum -y install ";;
'Arch'|'Manjaro'|'Bridge')
DISTRO_UPDATE="pacman -Syyu --noconfirm"; DISTRO_UPGRADE="pacman -Syyu"; DISTRO_GET="pacman -S "; DISTRO_INSTALL="pacman -S --noconfirm ";;
esac
#
# define the basic packages to install for using the different G-WAN servlets with Debian
# and its spin off.
#
if [ "$VENDOR" = "Ubuntu" ] || [ "$VENDOR" = "Debian" ] || [ "$VENDOR" = "Mint" ]
then
if [ "$NAME" != "maverick" ]
then
PACKAGES=" libtokyocabinet-dev libsqlite3-dev libtidy-dev libmemcached-tools libmemcached-dev libcairo2 libcairo2-dev mysql-client libmysqlclient-dev gettext openssl libssl-dev"
fi
fi
if [ "$VENDOR" = "Debian" ]
then
PACKAGES=$PACKAGES" make"
fi
#
# reload all the messages once the variables are set (don't even ask me why...
# but trust me because if I don't do it, some messages won't show the variables
# that were set within this function. Oops!)
#
get_tongue
}
# --------------------------------------------------------------------------------
#
#
# ================================================================================
#
# Start the execution of this script
#
# --------------------------------------------------------------------------------
clear
set_variables
display_intro
request_install
request_reboot
# --------------------------------------------------------------------------------
#
# End of script
#
# ================================================================================
Dernière modification par fnux (Le 03/08/2013, à 12:52)
N'engage pas un débat lors d'un dîner car celui qui n'a pas faim aura le dernier mot. - R. Whately
FWPBLA - The Froggies West Palm Beach Linux Association.
Hors ligne
#30 Le 03/08/2013, à 13:10
- fnux
Re : [Résolu] Comment modifier un fichier en bash par un script ".sh"?
Salut à tous,
ce petit post pour signaler la mise à jour de mon script en .v2m maintenant multi-ligues et dispo aussi bien pour Ubuntu que Debian et Mint mais aussi CentOS, Fedora et RHEL ainsi que pour ArchLinux, Bridge et Manjaro.
Voir post précédent.
A+.
N'engage pas un débat lors d'un dîner car celui qui n'a pas faim aura le dernier mot. - R. Whately
FWPBLA - The Froggies West Palm Beach Linux Association.
Hors ligne