Commit 3f85f451 authored by Florian's avatar Florian
Browse files

execute as sudo user mysql

parent f30e4c29
......@@ -57,9 +57,9 @@ sudo -u $COOPBOX_USER cp $COOPBOX_PATH/etherpad/settings.json.template $COOPBOX_
# ligne 158 : changer le texte par défaut par "Écrire à plusieurs ici"
# ligne 176 : mettre en francais "lang" : "fr"
mysql -u root -p"$DATABASE_PASS" -e "CREATE DATABASE $ETHERPAD_DATABASE;"
mysql -u root -p"$DATABASE_PASS" -e "GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on $ETHERPAD_DATABASE.* to '$ETHERPAD_DBUSER'@'localhost' identified by '$ETHERPAD_DBPASS';"
mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES"
sudo mysql -u root -p"$DATABASE_PASS" -e "CREATE DATABASE $ETHERPAD_DATABASE;"
sudo mysql -u root -p"$DATABASE_PASS" -e "GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on $ETHERPAD_DATABASE.* to '$ETHERPAD_DBUSER'@'localhost' identified by '$ETHERPAD_DBPASS';"
sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES"
cat > etherpad.service <<EOF
[Unit]
......@@ -85,9 +85,9 @@ echo "il faut faire le fichier de conf $COOPBOX_PATH/etherpad/settings.json et s
# Installer le Wiki
echo "Installation de YesWiki"
mysql -u root -p"$DATABASE_PASS" -e "CREATE DATABASE $YESWIKI_DATABASE;"
mysql -u root -p"$DATABASE_PASS" -e "GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on $YESWIKI_DATABASE.* to '$YESWIKI_DBUSER'@'localhost' identified by '$YESWIKI_DBPASS';"
mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES"
sudo mysql -u root -p"$DATABASE_PASS" -e "CREATE DATABASE $YESWIKI_DATABASE;"
sudo mysql -u root -p"$DATABASE_PASS" -e "GRANT CREATE,ALTER,SELECT,INSERT,UPDATE,DELETE on $YESWIKI_DATABASE.* to '$YESWIKI_DBUSER'@'localhost' identified by '$YESWIKI_DBPASS';"
sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES"
sudo -u $COOPBOX_USER git clone --branch cercopitheque https://github.com/YesWiki/yeswiki.git $COOPBOX_PATH/yeswiki
sudo -u $COOPBOX_USER cd $COOPBOX_PATH/yeswiki
# TODO install composer, setup autoupdate, extension ferme
......@@ -95,7 +95,7 @@ sudo -u $COOPBOX_USER cd $COOPBOX_PATH/yeswiki
# NGINX
sudo rm /etc/nginx/sites-enabled/default
sudo cat > /etc/nginx/sites-available/yeswiki <<EOF
cat > yeswiki <<EOF
server {
listen 80 default_server;
listen [::]:80 default_server;
......@@ -115,7 +115,7 @@ server {
}
}
EOF
sudo mv yeswiki /etc/nginx/sites-available/yeswiki
sudo ln -s /etc/nginx/sites-available/yeswiki /etc/nginx/sites-enabled/yeswiki
sudo systemctl restart nginx
# sudo nginx -t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment