#!/bin/sh clear #__________________________________ if [ $# -eq 0 ]; then Modus=0; else Modus=$1; fi echo "__________________________" #________________________________ if [ $Modus -eq 4 ]; then echo "Anzahl Parameter # $#" echo "Name 0 $0" echo "Parameter 1 1 $1" echo "Parameter 2 2 $2" echo "Alle Parameter @ $@" echo "Alle Parameter * $*" echo "PID $ $$" echo "Rückkehrcode ? $?" echo "__________________________" echo "Value 127 is returned by /bin/sh when the given command is not found within your" echo "PATH system variable and it is not a built-in shell command. In other words, the" echo "system doesn't understand your command, because it doesn't know where to find" echo "the binary you're trying to call." echo "__________________________" exit 4 fi #__________________________________ if [ $Modus -eq 3 ]; then echo "Parameter Bedeutung" echo " /0 Stiller Modus, nur die notwendigen Informationen" echo "1 Verbose, Ausgabe aller Informationen" echo "2 Nur Ausgabe der Version" echo "3 Diese Hilfe" echo "4 Zusätzliche Informationen" echo "8 Installieren Software" echo "9 Entfernen Software" echo "__________________________" exit 3 fi #________________________________ if [ $Modus -eq 2 ]; then echo "Prüfen Voraussetzungen Version 0.1 für Willie 4.5.1" echo "__________________________" echo "Author: Heinz Boettjer Kontakt: Heinz.Boettjer@freenet.de" echo "__________________________" echo "This work is licensed under the Creative Commons Attribution-ShareAlike 4.0" echo "International License. To view a copy of this license, visit" echo "http://creativecommons.org/licenses/by-sa/4.0/. Author Heinz Boettjer" echo "__________________________" exit 2 fi #________________________________ if [ $Modus -eq 8 ]; then sudo apt-get install python-pip sqlite libsqlite0 sudo pip install https://pypi.python.org/packages/source/w/willie/willie-4.5.1.tar.gz pygeoip praw ipython exit 8 fi #__________________________________ if [ $Modus -eq 9 ]; then sudo pip uninstall ipython praw pygeoip willie sudo apt-get remove libsqlite0 sqlite python-pip exit 9 fi #__________________________________ if [ $Modus -eq 1 ]; then echo "python -V 0 ???" fi python -V > /dev/null 2> /dev/null Status_python=$? #__________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "pip -V 0 127" echo "Installation: sudo apt-get install python-pip" fi pip -V > /dev/null 2> /dev/null Status_pip=$? #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "sqlite -version 1 127" fi sqlite -version > /dev/null 2> /dev/null Status_sqlite=$? #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "mysqlcheck -V 0 127" echo "Installation: sudo apt-get install mysql-client-core-5.6" fi mysqlcheck -V > /dev/null 2> /dev/null Status_mysqlcheck=$? #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "postgres -V 0 127" echo "Installation: sudo apt-get install postgres-xc-client postgres-xc libpq5" echo "Deinstallation: sudo apt-get remove postgres-xc-client postgres-xc libpq5" echo " (Reihenfolge wichtig)" fi postgres -V > /dev/null 2> /dev/null Status_postgres=$? #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "willie installiert ja nein" fi if [ -f /usr/local/bin/willie ]; then Status_willie="ja"; else Status_willie="nein"; fi #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "pygeoip installiert ja nein" fi if [ -d /usr/local/lib/python2.7/dist-packages/pygeoip ]; then Status_pygeoip="ja"; else Status_pygeoip="nein"; fi #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "praw installiert ja nein" fi if [ -d /usr/local/lib/python2.7/dist-packages/praw ]; then Status_praw="ja"; else Status_praw="nein"; fi #________________________________ if [ $Modus -eq 1 ]; then echo "__________________________" echo "praw installiert ja nein" echo "__________________________" fi if [ -d /usr/local/lib/python2.7/dist-packages/IPython ]; then Status_ipython="ja"; else Status_ipython="nein"; fi echo "python: $Status_python muss 0 sein" echo "pip: $Status_pip muss 0 sein" echo "sqlite: $Status_sqlite muss 1 sein" if [ $Modus -eq 1 ]; then echo "mysqlcheck: $Status_mysqlcheck 0=installiert 127=nicht installiert" echo " egal da dieser Ablauf auf sqlite abgestimmt ist" echo "postgres: $Status_postgres 0=installiert 127=nicht installiert" echo " egal da dieser Ablauf auf sqlite abgestimmt ist" fi echo "willie installiert: $Status_willie" echo "pygeoip installiert: $Status_pygeoip" echo "praw installiert: $Status_praw" echo "ipython installiert: $Status_ipython" echo "____________________________"
if [ $Modus -eq 1 ]; then exit 1; else exit 0; fi
This version of the page was edited by ec8or at 2015-10-17 20:39:13. View the most recent version.