From 3dab26c6797b32926287f22a041380080551060b Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 20:50:48 +0100 Subject: pici rendrakás --- .../mayor-installer-jav/install.d/60portal.sh | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100755 mayor-installer/mayor-installer-jav/install.d/60portal.sh (limited to 'mayor-installer/mayor-installer-jav/install.d/60portal.sh') diff --git a/mayor-installer/mayor-installer-jav/install.d/60portal.sh b/mayor-installer/mayor-installer-jav/install.d/60portal.sh new file mode 100755 index 00000000..62d5353e --- /dev/null +++ b/mayor-installer/mayor-installer-jav/install.d/60portal.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# + +cat < " + PW=$(pwgen -s1 32) + 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 + -- cgit v1.2.3