From cf30dceb15fa65f503c2a3f31f95b08ce1c65d35 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Wed, 28 Mar 2018 20:48:05 +0200 Subject: installer javítás 1 --- mayor-installer.fcgi/install.d/05checkdeb.sh | 86 -------------- mayor-installer.fcgi/install.d/10getsource.sh | 76 ------------ mayor-installer.fcgi/install.d/15createconfig.sh | 43 ------- mayor-installer.fcgi/install.d/20mysql.sh | 28 ----- mayor-installer.fcgi/install.d/25apache.sh | 67 ----------- mayor-installer.fcgi/install.d/30php.sh | 29 ----- .../install.d/35createdatabases.sh | 129 --------------------- mayor-installer.fcgi/install.d/40binary.sh | 44 ------- mayor-installer.fcgi/install.d/45intezmeny.sh | 70 ----------- mayor-installer.fcgi/install.d/50linker.sh | 58 --------- mayor-installer.fcgi/install.d/55tex.sh | 20 ---- mayor-installer.fcgi/install.d/60portal.sh | 119 ------------------- mayor-installer.fcgi/log/mayor-installer.rev | 1 - mayor-installer.fcgi/setup | 34 ------ mayor-installer/install.d/05checkdeb.sh | 44 +++++-- mayor-installer/install.d/15createconfig.sh | 8 +- mayor-installer/install.d/30php.sh | 23 +++- mayor-installer/install.d/35createdatabases.sh | 39 ++++--- mayor-installer/install.d/40binary.sh | 5 + mayor-installer/install.d/45intezmeny.sh | 10 +- mayor-installer/install.d/50linker.sh | 2 +- mayor-installer/install.d/60portal.sh | 10 +- 22 files changed, 90 insertions(+), 855 deletions(-) delete mode 100755 mayor-installer.fcgi/install.d/05checkdeb.sh delete mode 100755 mayor-installer.fcgi/install.d/10getsource.sh delete mode 100755 mayor-installer.fcgi/install.d/15createconfig.sh delete mode 100755 mayor-installer.fcgi/install.d/20mysql.sh delete mode 100755 mayor-installer.fcgi/install.d/25apache.sh delete mode 100755 mayor-installer.fcgi/install.d/30php.sh delete mode 100755 mayor-installer.fcgi/install.d/35createdatabases.sh delete mode 100755 mayor-installer.fcgi/install.d/40binary.sh delete mode 100755 mayor-installer.fcgi/install.d/45intezmeny.sh delete mode 100755 mayor-installer.fcgi/install.d/50linker.sh delete mode 100755 mayor-installer.fcgi/install.d/55tex.sh delete mode 100755 mayor-installer.fcgi/install.d/60portal.sh delete mode 100644 mayor-installer.fcgi/log/mayor-installer.rev delete mode 100755 mayor-installer.fcgi/setup diff --git a/mayor-installer.fcgi/install.d/05checkdeb.sh b/mayor-installer.fcgi/install.d/05checkdeb.sh deleted file mode 100755 index 56c0e55d..00000000 --- a/mayor-installer.fcgi/install.d/05checkdeb.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# -DEBIAN=false; -UBUNTU=false; -if [ `which lsb_release || echo "notinstalled"` == "notinstalled" ] -then - ISSUE=`cat /etc/issue | cut -d " " -f 1` - if [ "x${ISSUE}" == "xDebian" ]; then - DEBIAN=true; - RELEASE=`cat /etc/issue | cut -d " " -f 3` - elif [ "x${ISSUE}" == "xUbuntu" ]; then - UBUNTU=true; - RELEASE=`cat /etc/issue | cut -d " " -f 2` - fi -else - DISTRIBUTOR=$(lsb_release -i -s) - RELEASE=$(lsb_release -r -s) - if [ "x${DISTRIBUTOR}" == "xDebian" ]; then - DEBIAN=true; - elif [ "x${DISTRIBUTOR}" == "xUbuntu" ]; then - UBUNTU=true; - fi -fi -echo "Debian:" ${DEBIAN} -echo "Ubuntu:" ${UBUNTU} -echo "Version:" ${RELEASE} - -TEST=`grep contrib /etc/apt/sources.list` -if [ "$TEST" == "" ] -then - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "Az apt sources.list módosítása szükséges!" - if [ DEBIAN ]; then - echo "Debian Jessie (8) esetén például: - deb http://ftp.hu.debian.org/debian/ jessie main contrib non-free - deb http://security.debian.org/ jessie/updates main contrib non-free - deb http://ftp.hu.debian.org/debian/ jessie-updates main contrib non-free - " - fi - exit 255; -fi - -if [[ "x${RELEASE}" =~ ^x9.* ]] -then - PKGS="apache2 php php-json php-mysql php-ldap php-mbstring php-mcrypt php-curl mariadb-server-10.1 recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ntp wget ssl-cert ssh pwgen texlive-lang-european" -else - PKGS="apache2 php5 php5-json php5-mysqlnd php5-ldap php5-mcrypt php5-curl mysql-server recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ttf-mscorefonts-installer ntp wget ssl-cert ssh pwgen texlive-lang-european texlive-lang-hungarian" -fi - -if [ "$1" == "--no-deb" ]; then - exit 1 -fi - -cat </dev/null | sed 's/.*-\([^-]*\)\.tgz$/\1/' ) - -DO=n -if [ "$MENU" == '' ]; then - DO=i -else - echo " 0 Letöltés mindenképpen" - echo "${MENU}" | sed 's/.*-\([^-]*\)\.tgz$/\1/' | nl - read -n1 -p 'Melyiket telepítsem? ' SEL; echo - - if [ "$SEL" == 0 ]; then - DO=i - else - SELECT=$( echo "${MENU}" | sed -n ${SEL}p ) - - MAYORBASE="$TMPDIR/mayor-base-$SELECT.tgz" - MAYORNAPLO="$TMPDIR/mayor-naplo-$SELECT.tgz" - fi -fi - -if [ "$DO" == "i" ]; then - MAYORBASE="$TMPDIR/mayor-base-current.tgz" - MAYORNAPLO="$TMPDIR/mayor-naplo-current.tgz" - - echo -e "\nForrások letöltése:" - cd $TMPDIR - rm -f mayor-base-current.tgz - rm -f mayor-naplo-current.tgz - wget "http://www.mayor.hu/download/$VERSION/mayor-base-current.tgz" - wget "http://www.mayor.hu/download/$VERSION/mayor-naplo-current.tgz" -else - echo -e "\nA forráscsomagok letöltését kihagytam.\n" -fi - -read -n 1 -p "Telepítsem a forrás csomagokat? (i/N)" -s DO -if [ "$DO" != "i" ]; then echo -e "\nA forráscsomagok telepítését kihagytam.\n"; exit 1; fi - -echo -n -e "\nRendszer könyvtár: " -if [ ! -e $MAYORDIR ]; then - mkdir -p $MAYORDIR -fi -echo $MAYORDIR - -echo -e -n "Források kicsomagolása... " -cd $MAYORDIR -tar xfz "$MAYORBASE" -tar xfz "$MAYORNAPLO" -echo "ok." - diff --git a/mayor-installer.fcgi/install.d/15createconfig.sh b/mayor-installer.fcgi/install.d/15createconfig.sh deleted file mode 100755 index 51c512c4..00000000 --- a/mayor-installer.fcgi/install.d/15createconfig.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# - -cat < " - PW=`pwgen -s1` - cat "$MAYORDIR/config/$file.example" | sed s/%SQLPW%/$PW/ > "$MAYORDIR/config/$file" - echo $file - fi -done - -echo -n " module-naplo/config.php.example --> " -PW=`pwgen -s1` -PWREAD=`pwgen -s1` -if [ -e "$MAYORDIR/config/module-naplo/config.php" ]; then echo " module-naplo/config.php létezik."; else - cat "$MAYORDIR/config/module-naplo/config.php.example" | sed -e s/%SQLPW%/$PW/ -e s/%SQLPWREAD%/$PWREAD/ > "$MAYORDIR/config/module-naplo/config.php" - echo "module-naplo/config.php" -fi - -if [ -e "$MAYORDIR/config/skin-classic/naplo-config.php" ]; then echo " skin-classic/naplo-config.php létezik."; else - echo -n " skin-classic/naplo-config.php.example --> " - cp $MAYORDIR/config/skin-classic/naplo-config.php.example $MAYORDIR/config/skin-classic/naplo-config.php - echo "config/skin-classic/naplo-config.php" -fi diff --git a/mayor-installer.fcgi/install.d/20mysql.sh b/mayor-installer.fcgi/install.d/20mysql.sh deleted file mode 100755 index 2979f728..00000000 --- a/mayor-installer.fcgi/install.d/20mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# - -cat < /dev/null - echo ok -else - echo "már engedélyezett" -fi - echo -n " - ModReWrite engedélyezése ... " -if [ ! -e /etc/apache2/mods-enabled/rewrite.load ]; then - a2enmod rewrite > /dev/null - echo ok -else - echo "már engedélyezett" -fi -echo "ok." - -SERVERNAME="" -while [ "$SERVERNAME" = "" ] -do - read -p " A web szerver teljes domain neve (pl: mayor.tesztsuli.hu): " SERVERNAME -done - -#cat $MAYORDIR/install/base/apache2/mayor.conf | sed "s/ServerName your.mayor.server.hu/ServerName $SERVERNAME/" > /etc/apache2/sites-available/mayor.conf - -# A 2.4-es apache esetén módosítani kell a konfig állományt! -APACHE_VERSION=$(dpkg -l apache2 | grep apache2 | tr -s ' ' | cut -d ' ' -f 3 | cut -d '-' -f 1 | sed 's/\..$//') -cat $MAYORDIR/install/base/apache2/mayor.conf | sed \ - -e "s/ServerName your.mayor.server.hu/ServerName $SERVERNAME/" > /etc/apache2/sites-available/mayor.conf - - -if [ ! -e /etc/apache2/sites-enabled/mayor.conf ]; then - echo " A mayor site engedélyezése" - a2ensite mayor.conf > /dev/null -fi - -echo " A web-szerver újraindítása" -/etc/init.d/apache2 restart diff --git a/mayor-installer.fcgi/install.d/30php.sh b/mayor-installer.fcgi/install.d/30php.sh deleted file mode 100755 index 49000c68..00000000 --- a/mayor-installer.fcgi/install.d/30php.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# - -cat < /etc/php5/apache2/php.ini -echo 256M - -echo " Az web szerver újraindítása" -/etc/init.d/apache2 restart - diff --git a/mayor-installer.fcgi/install.d/35createdatabases.sh b/mayor-installer.fcgi/install.d/35createdatabases.sh deleted file mode 100755 index d44d28e4..00000000 --- a/mayor-installer.fcgi/install.d/35createdatabases.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash -# - -cat < mayor-login.sql -DB=`grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ - -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-parent.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ - -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-private.sql -DB=`grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USERREAD=`egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PW=`egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PWREAD=`egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -cat $MAYORDIR/install/module-naplo/mysql/base.sql | sed -e "s/%MYSQL_NAPLO_DB%/$DB/g" -e "s/%MYSQL_NAPLO_USER%/$USER/g" \ - -e "s/%MYSQL_NAPLO_PW%/$PW/g" -e "s/%MYSQL_NAPLO_USER_READ%/$USERREAD/g" \ - -e "s/%MYSQL_NAPLO_PW_READ%/$PWREAD/g" > base.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` - -cat $MAYORDIR/install/base/mysql/private-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > private-users.sql -cat $MAYORDIR/install/module-naplo/mysql/naplo-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > naplo-users.sql - -echo " A létrejött sql fileok:" -FILES=`ls *.sql` -for f in $FILES -do - echo " * ${f}"; -done; -read -n 1 -p "Telepíthetem? (i/N)" -s DO -if [ "$DO" != "i" ]; then echo " ok, kiléptem..."; exit 1; fi -echo -e "\n" - -read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW - -if [ ! -e $MAYORDIR/config/main.conf ]; then - cat $MAYORDIR/config/main.conf.example | sed s/%SQLPW%/$MYSQLROOTPW/ > $MAYORDIR/config/main.conf - chmod 600 $MAYORDIR/config/main.conf -fi - -if [ "$MYSQLROOTPW" = "" ]; -then - MYSQLROOTPWSTR=""; -else - MYSQLROOTPWSTR="-p$MYSQLROOTPW --user=root" -fi - -cat /tmp/mysql/mayor-login.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 -cat /tmp/mysql/mayor-parent.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 -cat /tmp/mysql/mayor-private.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 -cat /tmp/mysql/base.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 -cat /tmp/mysql/private-users.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 -cat /tmp/mysql/naplo-users.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 - -echo -e "\n" -echo "A telepítés végeztével beléphetsz a webes felületen! -========================================================= - user: mayoradmin -========================================================= - jelszó: jelszo -========================================================= -" diff --git a/mayor-installer.fcgi/install.d/40binary.sh b/mayor-installer.fcgi/install.d/40binary.sh deleted file mode 100755 index bc2716af..00000000 --- a/mayor-installer.fcgi/install.d/40binary.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# - -cat < $TMPDIR/mysql/intezmeny.sql - -insert into $DB.intezmeny (OMKod, rovidNev, nev, alapertelmezett) VALUES ('$OMKOD','$ROVID','$INTEZMENYNEV',1); -create database intezmeny_$ROVID character set utf8 collate utf8_hungarian_ci; -grant select,execute on intezmeny_$ROVID.* to '$USERREAD'@'localhost'; -grant all on intezmeny_$ROVID.* to '$USER'@'localhost'; -use intezmeny_$ROVID; - -EOF - -if [ "$MYSQLROOTPW" == "" ]; then - read -p " A mysql root jelszó -ha van!- (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW -fi -#Ezt miért is akarom kiírni? -#echo $MYSQLROOTPW - a jelszó -if [ "$MYSQLROOTPW" = "" ]; -then - MYSQLROOTPWSTR=""; -else - MYSQLROOTPWSTR="-p$MYSQLROOTPW --user=root" -fi - -cat $TMPDIR/mysql/intezmeny.sql $MAYORDIR/install/module-naplo/mysql/intezmeny.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 $INTEZMENYDB diff --git a/mayor-installer.fcgi/install.d/50linker.sh b/mayor-installer.fcgi/install.d/50linker.sh deleted file mode 100755 index 3801354c..00000000 --- a/mayor-installer.fcgi/install.d/50linker.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -cat < $MAYORDIR/www/policy/$POLICY/$file" - ln -s $MAYORDIR/www/policy/private/$file $MAYORDIR/www/policy/$POLICY/$file - else - echo " Hiányzó file: $MAYORDIR/www/policy/private/$file" - fi - else - echo " [OK] A file már létezik: " $file - fi - done - done -done diff --git a/mayor-installer.fcgi/install.d/55tex.sh b/mayor-installer.fcgi/install.d/55tex.sh deleted file mode 100755 index 87bcbc5f..00000000 --- a/mayor-installer.fcgi/install.d/55tex.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -cat < " - PW=`pwgen -s1` - if [ "$ROVID" = "" ]; then - ROVID="demo" - fi - cat "$MAYORDIR/config/$file.example" | sed -e "s/%SQLPW%/$PW/" -e "s/demo/${ROVID}/" > "$MAYORDIR/config/$file" - echo $file -fi - -echo -e "\n SQL file létrehozása... " -if [ ! -d $TMPDIR/mysql ]; then - mkdir -p $TMPDIR/mysql -fi -cd $TMPDIR/mysql -PDB=`grep db $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` -USER=`grep user $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` -PW=`grep pw $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` - -cat $MAYORDIR/install/mayor-portal/mysql/mayor-portal.sql | sed \ - -e "s/%MYSQL_PORTAL_DB%/$PDB/g" \ - -e "s/%MYSQL_PORTAL_USER%/$USER/g" \ - -e "s/%MYSQL_PORTAL_PW%/$PW/g" > mayor-portal.sql - -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -cat $MAYORDIR/install/mayor-portal/mysql/portal-init.sql | sed \ - -e "s/%MYSQL_PRIVATE_DB%/$DB/g" \ - -e "s/%MYSQL_PORTAL_DB%/$PDB/g" > portal-init.sql - -read -n 1 -p "Telepíthetem? (i/N)" -s DO -if [ "$DO" != "i" ]; then echo " ok, kiléptem..."; exit 1; fi -echo -e "\n" - -if [ "$MYSQLROOTPW" == "" ]; then - read -p " A mysql root jelszó -ha van- (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW -fi - -if [ "$MYSQLROOTPW" = "" ]; -then - MYSQLROOTPWSTR=""; -else - MYSQLROOTPWSTR="-p$MYSQLROOTPW --user=root" -fi - - -cat /tmp/mysql/mayor-portal.sql /tmp/mysql/portal-init.sql | mysql $MYSQLROOTPWSTR --default-character-set=utf8 - -read -n 1 -p "Tegyük a portál oldalt a rendszer kezdőlapjává minden hozzáférési szinten? (i/N)" -s DO -if [ "$DO" != "i" ]; then - echo -e "\nA portál oldalt nem teszem kezdőlappá.\n"; - cat <'portal', 'sub' => 'portal', 'f' => 'portal');/" $MAYORDIR/config/$file - echo ok - done -fi - -if [ "$ROVID" != "demo" ]; then - echo -e "\nEgyedi kezdőoldalak létrehozása:" - for policy in private public parent; do - echo -n " $policy " - for skin in classic pda; do - cp $MAYORDIR/www/policy/$policy/portal/portal/portal_demo.$skin.php $MAYORDIR/www/policy/$policy/portal/portal/portal_$ROVID.$skin.php - echo -n "... " - done - echo "ok" - done -fi - diff --git a/mayor-installer.fcgi/log/mayor-installer.rev b/mayor-installer.fcgi/log/mayor-installer.rev deleted file mode 100644 index 87ca4f07..00000000 --- a/mayor-installer.fcgi/log/mayor-installer.rev +++ /dev/null @@ -1 +0,0 @@ -4284 diff --git a/mayor-installer.fcgi/setup b/mayor-installer.fcgi/setup deleted file mode 100755 index 3c13a155..00000000 --- a/mayor-installer.fcgi/setup +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -clear -echo "-------------------------------------------" -echo " MaYoR Setup " -echo "-------------------------------------------" - -MAYORDIR="/var/mayor" -TMPDIR="/tmp" -MYSQLROOTPW="" -VERSION="current" -export MAYORDIR -export TMPDIR -export MYSQLROOTPW -export VERSION - -echo -e "A MaYoR keretrendszer és elektronikus napló telepítője a továbbiakban -több lépésben, az egyes lépésekre jóváhagyást kérve fogja végrehajtani a -telepítés és konfigurálás lépéseit. - -A telepítő egy tipikus telepítés esetén alkalmazható, speciális igények esetén -célszerűbb az egyes lépéseket a telepítési útmutató alapján manuálisan végezni.\n" - -read -n 1 -p "Folytatja? (i/N)" -s DO -if [ "$DO" != "i" ]; then echo " ok, kiléptem..."; exit 1; fi -echo -e "\n" - -for f in install.d/* -do - echo -e "\n----------------------------------------------\n$f\n----------------------------------------------\n" - ./$f $@ - if [ "$?" == 255 ]; then echo "Fatális hiba! A telepítő kilép."; exit 255; fi; -done - -echo -e "MaYoR (c) setup\n" diff --git a/mayor-installer/install.d/05checkdeb.sh b/mayor-installer/install.d/05checkdeb.sh index 56c0e55d..2488d60a 100755 --- a/mayor-installer/install.d/05checkdeb.sh +++ b/mayor-installer/install.d/05checkdeb.sh @@ -2,15 +2,15 @@ # DEBIAN=false; UBUNTU=false; -if [ `which lsb_release || echo "notinstalled"` == "notinstalled" ] +if [ $(which lsb_release || echo "notinstalled") == "notinstalled" ] then - ISSUE=`cat /etc/issue | cut -d " " -f 1` + ISSUE=$(cat /etc/issue | cut -d " " -f 1) if [ "x${ISSUE}" == "xDebian" ]; then DEBIAN=true; - RELEASE=`cat /etc/issue | cut -d " " -f 3` + RELEASE=$(cat /etc/issue | cut -d " " -f 3) elif [ "x${ISSUE}" == "xUbuntu" ]; then UBUNTU=true; - RELEASE=`cat /etc/issue | cut -d " " -f 2` + RELEASE=$(cat /etc/issue | cut -d " " -f 2) fi else DISTRIBUTOR=$(lsb_release -i -s) @@ -25,7 +25,7 @@ echo "Debian:" ${DEBIAN} echo "Ubuntu:" ${UBUNTU} echo "Version:" ${RELEASE} -TEST=`grep contrib /etc/apt/sources.list` +TEST=$(grep contrib /etc/apt/sources.list) if [ "$TEST" == "" ] then echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" @@ -35,16 +35,36 @@ then deb http://ftp.hu.debian.org/debian/ jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free deb http://ftp.hu.debian.org/debian/ jessie-updates main contrib non-free - " + +Debian 9 esetén például: + deb http://ftp.hu.debian.org/debian/ stretch main contrib non-free + deb http://security.debian.org/debian-security stretch/updates main contrib non-free + deb http://ftp.hu.debian.org/debian/ stretch-updates main contrib non-free + \n" + + read -n 1 -p "Hozzáadhatom? (egyelőre csak Debian9 esetén működik) (i/N)" -s DO + if [ "$DO" != "i" ]; then echo -e "\nA hozzáadást kihagytam.\n"; exit 255; fi + + if [[ "x${RELEASE}" =~ ^x9.* ]]; then + echo -e "#mayor miatt is: +deb http://ftp.hu.debian.org/debian/ stretch contrib non-free +deb http://security.debian.org/debian-security stretch/updates contrib non-free +deb http://ftp.hu.debian.org/debian/ stretch-updates contrib non-free" >> /etc/apt/sources.list + + fi + echo -e "\n ---- csomaglista frissítése ---- \n" + apt update ## frisítés + echo -e "\n ------------- kész ------------- \n" + fi - exit 255; +# exit 255; fi if [[ "x${RELEASE}" =~ ^x9.* ]] then - PKGS="apache2 php php-json php-mysql php-ldap php-mbstring php-mcrypt php-curl mariadb-server-10.1 recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ntp wget ssl-cert ssh pwgen texlive-lang-european" + PKGS="apache2 php libapache2-mod-php php-json php-mysql php-ldap php-mbstring php-mcrypt php-curl mariadb-server recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ntp wget ssl-cert ssh pwgen texlive-lang-european" else - PKGS="apache2 php5 php5-json php5-mysqlnd php5-ldap php5-mcrypt php5-curl mysql-server recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ttf-mscorefonts-installer ntp wget ssl-cert ssh pwgen texlive-lang-european texlive-lang-hungarian" + PKGS="apache2 php5 libapache2-mod-php5 php5-json php5-mysqlnd php5-ldap php5-mcrypt php5-curl mysql-server recode texlive texlive-fonts-extra texlive-latex-extra texlive-binaries texlive-xetex ttf-mscorefonts-installer ntp wget ssl-cert ssh pwgen texlive-lang-european texlive-lang-hungarian" fi if [ "$1" == "--no-deb" ]; then @@ -69,7 +89,7 @@ MISSING="" for pkg in $PKGS do echo -n " $pkg ... " - STAT=`dpkg -l $pkg | grep $pkg | cut -f 1 -d ' '` + STAT=$(dpkg -l $pkg | grep $pkg | cut -f 1 -d ' ') if [ "$STAT" == "ii" ]; then echo ok else @@ -81,6 +101,6 @@ if [ "$MISSING" != "" ]; then echo Még nem telepített csomagok: $MISSING read -n 1 -p "Telepítsem? (i/N)" -s DO if [ "$DO" != "i" ]; then echo " ok, kiléptem..."; exit 1; fi - apt-get update - apt-get -m -f install $MISSING + apt update + apt -m -f install $MISSING fi diff --git a/mayor-installer/install.d/15createconfig.sh b/mayor-installer/install.d/15createconfig.sh index 51c512c4..8d035fe1 100755 --- a/mayor-installer/install.d/15createconfig.sh +++ b/mayor-installer/install.d/15createconfig.sh @@ -14,7 +14,7 @@ read -n 1 -p "Létrehozzam a minták alapján a konfigurációs állományokat? if [ "$DO" != "i" ]; then echo -e "\nA konfigurációs állományokat nem hoztam létre.\n"; exit 1; fi if [ "$MAYORDIR" = "" ]; then echo "A MAYORDIR változó üres. Kilépek."; exit 1; fi -PWGEN=`which pwgen` +PWGEN=$(which pwgen) if [ "${PWGEN}" = "" ]; then echo "A pwgen szoftver nincs telepítve."; exit 1; fi echo -e "\nKonfigurációs állományok létrehozása:" @@ -22,15 +22,15 @@ for file in main-config.php parent-conf.php private-conf.php public-conf.php do if [ -e "${MAYORDIR}/config/${file}" ]; then echo " $file létezik."; else echo -n " $file.example --> " - PW=`pwgen -s1` + PW=(pwgen -s1 32) cat "$MAYORDIR/config/$file.example" | sed s/%SQLPW%/$PW/ > "$MAYORDIR/config/$file" echo $file fi done echo -n " module-naplo/config.php.example --> " -PW=`pwgen -s1` -PWREAD=`pwgen -s1` +PW=$(pwgen -s1 32) +PWREAD=$(pwgen -s1 32) if [ -e "$MAYORDIR/config/module-naplo/config.php" ]; then echo " module-naplo/config.php létezik."; else cat "$MAYORDIR/config/module-naplo/config.php.example" | sed -e s/%SQLPW%/$PW/ -e s/%SQLPWREAD%/$PWREAD/ > "$MAYORDIR/config/module-naplo/config.php" echo "module-naplo/config.php" diff --git a/mayor-installer/install.d/30php.sh b/mayor-installer/install.d/30php.sh index 49000c68..5f751018 100755 --- a/mayor-installer/install.d/30php.sh +++ b/mayor-installer/install.d/30php.sh @@ -15,14 +15,25 @@ EOF read -n 1 -p "A php.ini-t módosíthatom? (i/N)" -s DO if [ "$DO" != "i" ]; then echo -e "\nNem módosítom a php.ini-t.\n"; exit 1; fi -exit 1 -echo -n " A PHP memória limit beállítása: " -if [ ! -e /etc/php5/apache2/php.ini.mayor ]; then - mv /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini.mayor +if [[ "x${RELEASE}" =~ ^x9.* ]]; then + + if [ ! -e /etc/php/7.0/apache2/php.ini.mayor ]; then + cp /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.mayor + fi + cat /etc/php/7.0/apache2/php.ini.mayor | sed "s/memory_limit/memory_limit = 256M ; old value: /" > /etc/php/7.0/apache2/php.ini + echo -e "256M" + +else + + echo -n " A PHP memória limit beállítása: " + if [ ! -e /etc/php5/apache2/php.ini.mayor ]; then + cp /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini.mayor + fi + + cat /etc/php5/apache2/php.ini.mayor | sed "s/memory_limit/memory_limit = 256M ; old value: /" > /etc/php5/apache2/php.ini + echo -e "256M" fi -cat /etc/php5/apache2/php.ini.mayor | sed "s/memory_limit/memory_limit = 256M ; old value: /" > /etc/php5/apache2/php.ini -echo 256M echo " Az web szerver újraindítása" /etc/init.d/apache2 restart diff --git a/mayor-installer/install.d/35createdatabases.sh b/mayor-installer/install.d/35createdatabases.sh index d44d28e4..718ca3c2 100755 --- a/mayor-installer/install.d/35createdatabases.sh +++ b/mayor-installer/install.d/35createdatabases.sh @@ -40,13 +40,13 @@ if [ ! -e $MAYORDIR/log/mayor-base.rev ]; then echo " Hiányzó mayor-base.rev file"; if [ -e $MAYORDIR/log/revision ]; then - IREV=`cat $MAYORDIR/log/revision` + IREV=$(cat $MAYORDIR/log/revision) else IREV=""; fi else cp $MAYORDIR/log/mayor-base.rev $MAYORDIR/log/revision - IREV=`cat $MAYORDIR/log/revision` + IREV=$(cat $MAYORDIR/log/revision) fi echo " Az aktuális revision: ${IREV}" @@ -60,36 +60,36 @@ fi echo " SQL fileok létrehozása... " mkdir -p $TMPDIR/mysql cd $TMPDIR/mysql -DB=`grep db $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`grep user $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PW=`grep pw $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` +DB=$(grep db $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") +USER=$(grep user $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") +PW=$(grep pw $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") cat $MAYORDIR/install/base/mysql/mayor-login.sql | sed -e "s/%MYSQL_LOGIN_DB%/$DB/g" -e "s/%MYSQL_LOGIN_USER%/$USER/g" \ -e "s/%MYSQL_LOGIN_PW%/$PW/g" > mayor-login.sql -DB=`grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +USER=$(grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +PW=$(grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-parent.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +USER=$(grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +PW=$(grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-private.sql -DB=`grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USERREAD=`egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PW=`egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PWREAD=`egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +DB=$(grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USER=$(egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USERREAD=$(egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +PW=$(egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +PWREAD=$(egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") cat $MAYORDIR/install/module-naplo/mysql/base.sql | sed -e "s/%MYSQL_NAPLO_DB%/$DB/g" -e "s/%MYSQL_NAPLO_USER%/$USER/g" \ -e "s/%MYSQL_NAPLO_PW%/$PW/g" -e "s/%MYSQL_NAPLO_USER_READ%/$USERREAD/g" \ -e "s/%MYSQL_NAPLO_PW_READ%/$PWREAD/g" > base.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/private-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > private-users.sql cat $MAYORDIR/install/module-naplo/mysql/naplo-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > naplo-users.sql echo " A létrejött sql fileok:" -FILES=`ls *.sql` +FILES=$(ls *.sql) for f in $FILES do echo " * ${f}"; @@ -100,8 +100,11 @@ echo -e "\n" read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW + if [ ! -e $MAYORDIR/config/main.conf ]; then cat $MAYORDIR/config/main.conf.example | sed s/%SQLPW%/$MYSQLROOTPW/ > $MAYORDIR/config/main.conf +# BDIR=$(echo $MAYORDIR | sed -e 's:\/:\\\/:g') +# sed -e "s/BASEDIR=\"\/var\/mayor\"/BASEDIR=\"$BDIR\"/g" -i $MAYORDIR/config/main.conf chmod 600 $MAYORDIR/config/main.conf fi diff --git a/mayor-installer/install.d/40binary.sh b/mayor-installer/install.d/40binary.sh index bc2716af..e0f0598b 100755 --- a/mayor-installer/install.d/40binary.sh +++ b/mayor-installer/install.d/40binary.sh @@ -32,6 +32,11 @@ fi echo -e "\n Az /usr/local/sbin/ alá létrejött a mayor szimbolikus link."; fi if [ ! -e $MAYORDIR/config/main.conf ]; then cp $MAYORDIR/config/main.conf.example $MAYORDIR/config/main.conf; fi + # A BASEDIR változó pontosítása + BDIR=$(echo $MAYORDIR | sed -e 's:\/:\\\/:g') + sed -e "s/BASEDIR=\"\/var\/mayor\"/BASEDIR=\"$BDIR\"/g" -i $MAYORDIR/config/main.conf + # A webserver_user lecserélése, ha nem www-data lenne + sed -e "s/WEB_SERVER_USER=\"www-data\"/WEB_SERVER_USER=\"$WEB_SERVER_USER\"/g" -i $MAYORDIR/config/main.conf # A konfig könyvtár védelme chown -R $WEB_SERVER_USER $MAYORDIR/config/ chmod 700 $MAYORDIR/config/ diff --git a/mayor-installer/install.d/45intezmeny.sh b/mayor-installer/install.d/45intezmeny.sh index fc8eafeb..c41dda18 100755 --- a/mayor-installer/install.d/45intezmeny.sh +++ b/mayor-installer/install.d/45intezmeny.sh @@ -26,13 +26,13 @@ echo -e "\n" OMKOD="" while [ "$OMKOD" = "" ]; do read -p "Kérem az intézmény OM kódját: " OMKOD - OMKOD=`echo ${OMKOD} | sed "s/[^[0-9]]*//g"` + OMKOD=$(echo ${OMKOD} | sed "s/[^[0-9]]*//g") done read -p "Kérem az intézmény nevét: " INTEZMENYNEV ROVID="" while [ "$ROVID" = "" ]; do read -p "Kérem az intézmény rövid nevét (néhány karakteres rövidítés, mint \"vmg\", \"illyes\"...: " ROVID - ROVID=`echo ${ROVID} | sed "s/[^[:alnum:]]*//g" | sed "y, űáéúőóüöíŰÁÉÚŐÓÜÖÍ,_uaeuoouoiUAEUOOUOI," | sed 's/\(.*\)/\L\1/'` + ROVID=$(echo ${ROVID} | sed "s/[^[:alnum:]]*//g" | sed "y, űáéúőóüöíŰÁÉÚŐÓÜÖÍ,_uaeuoouoiUAEUOOUOI," | sed 's/\(.*\)/\L\1/') done echo -e "\nOM: ${OMKOD}; Rövidnév: ${ROVID}\n" @@ -40,9 +40,9 @@ echo -n " Az intézmény konfigurációs állománya: " cp "$MAYORDIR/config/module-naplo/config-pl.php.example" "$MAYORDIR/config/module-naplo/config-$ROVID.php" echo "$MAYORDIR/config/module-naplo/config-$ROVID.php" -DB=`grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USERREAD=`egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +DB=$(grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USER=$(egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USERREAD=$(egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") echo -e "\nAz adatbázis létrehozása\n" cat < $TMPDIR/mysql/intezmeny.sql diff --git a/mayor-installer/install.d/50linker.sh b/mayor-installer/install.d/50linker.sh index 3801354c..73887902 100755 --- a/mayor-installer/install.d/50linker.sh +++ b/mayor-installer/install.d/50linker.sh @@ -34,7 +34,7 @@ POLICIES="parent public" for POLICY in $POLICIES; do eval "LIST=\$${POLICY}Link" for f in $LIST; do - DIR=`echo $f | cut -d / -f 1-2` + DIR=$(echo $f | cut -d / -f 1-2) if [ ! -d $MAYORDIR/www/policy/$POLICY/$DIR ]; then echo " Könyvtár: $MAYORDIR/www/policy/$POLICY/$DIR" mkdir -p $MAYORDIR/www/policy/$POLICY/$DIR diff --git a/mayor-installer/install.d/60portal.sh b/mayor-installer/install.d/60portal.sh index e8ccfe90..62d5353e 100755 --- a/mayor-installer/install.d/60portal.sh +++ b/mayor-installer/install.d/60portal.sh @@ -40,7 +40,7 @@ echo -e "\nA porál modul konfigurációs állományának létrehozása" file="module-portal/config.php" if [ -e "${MAYORDIR}/config/${file}" ]; then echo " $file létezik."; else echo -n " $file.example --> " - PW=`pwgen -s1` + PW=$(pwgen -s1 32) if [ "$ROVID" = "" ]; then ROVID="demo" fi @@ -53,16 +53,16 @@ if [ ! -d $TMPDIR/mysql ]; then mkdir -p $TMPDIR/mysql fi cd $TMPDIR/mysql -PDB=`grep db $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` -USER=`grep user $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` -PW=`grep pw $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g"` +PDB=$(grep db $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g") +USER=$(grep user $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g") +PW=$(grep pw $MAYORDIR/config/$file | sed -e "s/.*=\ *['\"]//g" -e "s/['\"];//g") cat $MAYORDIR/install/mayor-portal/mysql/mayor-portal.sql | sed \ -e "s/%MYSQL_PORTAL_DB%/$PDB/g" \ -e "s/%MYSQL_PORTAL_USER%/$USER/g" \ -e "s/%MYSQL_PORTAL_PW%/$PW/g" > mayor-portal.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/mayor-portal/mysql/portal-init.sql | sed \ -e "s/%MYSQL_PRIVATE_DB%/$DB/g" \ -e "s/%MYSQL_PORTAL_DB%/$PDB/g" > portal-init.sql -- cgit v1.2.3