Compare commits
No commits in common. "69aef9fb9fb7c4f36788159e5b21ef45505a0e1e" and "97a95c9a91a2e1c617dda70a8528bad9eb5dccb2" have entirely different histories.
69aef9fb9f
...
97a95c9a91
@ -6,8 +6,6 @@ module.exports = {
|
|||||||
// chez ultracc par exemple la commande est app-ports free
|
// chez ultracc par exemple la commande est app-ports free
|
||||||
port: Voir indications ci dessus,
|
port: Voir indications ci dessus,
|
||||||
|
|
||||||
// choisir mysql ou sqlite
|
|
||||||
dbtype: 'sqlite',
|
|
||||||
// Chemin vers le fichier de base de données SQLite
|
// Chemin vers le fichier de base de données SQLite
|
||||||
dbFile: path.join(__dirname, 'base_autopost.db'),
|
dbFile: path.join(__dirname, 'base_autopost.db'),
|
||||||
|
|
||||||
|
|||||||
14
bin/postauto
14
bin/postauto
@ -7,20 +7,14 @@ source /home/$USER/autopost/common.sh
|
|||||||
checkdb() {
|
checkdb() {
|
||||||
if [ "$dbtype" = "sqlite" ]; then
|
if [ "$dbtype" = "sqlite" ]; then
|
||||||
if [ ! -f "$DB_FILE" ]; then
|
if [ ! -f "$DB_FILE" ]; then
|
||||||
echo "La base de données SQLite n'existe pas. Création…"
|
echo "La base de données n'existe pas. Création..."
|
||||||
do_createdb
|
do_createdb
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Échapper _ et % pour LIKE
|
# Vérifie si la table existe, sinon crée-la
|
||||||
local pattern=${MYSQL_TABLE//_/\\_}
|
exists=$(db_query "SHOW TABLES LIKE \`$MYSQL_TABLE\`;")
|
||||||
pattern=${pattern//%/\\%}
|
|
||||||
|
|
||||||
# Assure-toi que db_query utilise `mysql -N -B` pour ne pas avoir d'entêtes
|
|
||||||
local exists
|
|
||||||
exists=$(db_query "SHOW TABLES LIKE '${pattern}';" | tr -d '[:space:]')
|
|
||||||
|
|
||||||
if [ -z "$exists" ]; then
|
if [ -z "$exists" ]; then
|
||||||
echo "La table '${MYSQL_TABLE}' n'existe pas. Création…"
|
echo "La table 'release' n'existe pas. Création..."
|
||||||
do_createdb
|
do_createdb
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user