aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-installer/install.d
diff options
context:
space:
mode:
authorM.Gergo2018-03-28 20:48:05 +0200
committerM.Gergo2018-03-28 20:48:05 +0200
commitcf30dceb15fa65f503c2a3f31f95b08ce1c65d35 (patch)
tree3d51eabdf4c9bc7a3daca03d265c052fb0601ac2 /mayor-installer/install.d
parent20a9412f1f5bc7b7e40ffb24e262cdf20420983c (diff)
downloadmayor-cf30dceb15fa65f503c2a3f31f95b08ce1c65d35.tar.gz
mayor-cf30dceb15fa65f503c2a3f31f95b08ce1c65d35.zip
installer javítás 1
Diffstat (limited to 'mayor-installer/install.d')
-rwxr-xr-xmayor-installer/install.d/05checkdeb.sh44
-rwxr-xr-xmayor-installer/install.d/15createconfig.sh8
-rwxr-xr-xmayor-installer/install.d/30php.sh23
-rwxr-xr-xmayor-installer/install.d/35createdatabases.sh39
-rwxr-xr-xmayor-installer/install.d/40binary.sh5
-rwxr-xr-xmayor-installer/install.d/45intezmeny.sh10
-rwxr-xr-xmayor-installer/install.d/50linker.sh2
-rwxr-xr-xmayor-installer/install.d/60portal.sh10
8 files changed, 90 insertions, 51 deletions
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 <<EOF > $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