You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Determine if the site was previously built by checking for both .htaccess and settings.php in the public file dir.
9
+
if [ -f"$DRUPAL_ROOT/sites/default/files/.htaccess" ] && [ -f"$DRUPAL_ROOT/sites/default/files/settings.php" ];then
10
+
touch /tmp/DRUPAL_FILES_LIVE
11
+
echo"Triage : Found Drupal Filesystem and settings.php."
13
12
fi
14
13
15
-
# Determine if the site was previously built by checking the public file dir.
16
-
if [ -f"$DRUPAL_ROOT/sites/default/files/.htaccess" ];then
17
-
touch /tmp/DRUPAL_FILES_LIVE
18
-
echo"Triage : Found Drupal Filesystem."
14
+
# Check if the database has tables named *node*. If so, this is likely a live DB.
15
+
if [ -f /tmp/DRUPAL_FILES_LIVE ];then
16
+
TABLE_COUNT=$($DRUSH sql-query "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name LIKE '%node%';" --skip-column-names)
17
+
if [ "$TABLE_COUNT"-gt 0 ];then
18
+
touch /tmp/DRUPAL_DB_LIVE
19
+
echo"Triage : Found Drupal Database with $TABLE_COUNT node tables."
0 commit comments