Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ac1f796cc | |||
| b6ae4b9c65 | |||
| f9ae2477ed | |||
| e2052b4b45 | |||
| 00cdb0a663 |
+41
-3
@@ -129,6 +129,11 @@ cat .sysref.beta | head -20
|
|||||||
|
|
||||||
# Count records by type
|
# Count records by type
|
||||||
awk -F'|' '{print $1}' .sysref.beta | sort | uniq -c
|
awk -F'|' '{print $1}' .sysref.beta | sort | uniq -c
|
||||||
|
|
||||||
|
# Count total lines (includes headers and all records)
|
||||||
|
wc -l .sysref.beta
|
||||||
|
# Note: This total includes system records, user records, headers, and blank lines
|
||||||
|
# NOT the count of WordPress sites
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -192,16 +197,49 @@ Now when you pull:
|
|||||||
|
|
||||||
## Recommended Workflow
|
## Recommended Workflow
|
||||||
|
|
||||||
|
### Non-Git Deployment (wget/extract without git)
|
||||||
|
```bash
|
||||||
|
# 1. Download and extract fresh code
|
||||||
|
wget https://your-repo-url/archive.tar.gz
|
||||||
|
tar -xzf archive.tar.gz
|
||||||
|
|
||||||
|
# 2. If updating in same directory, clear old cache
|
||||||
|
bash launcher.sh --clear-cache
|
||||||
|
|
||||||
|
# 3. Run fresh detection
|
||||||
|
bash launcher.sh --detect-only
|
||||||
|
|
||||||
|
# 4. Run normally
|
||||||
|
bash launcher.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: Cache files are NOT included in download archives (excluded via .gitignore), so fresh extracts always start clean.
|
||||||
|
|
||||||
|
### Fresh Deployment (First Clone or Migration)
|
||||||
|
```bash
|
||||||
|
# 1. Clone or navigate to toolkit directory
|
||||||
|
cd /root/server-toolkit-beta
|
||||||
|
|
||||||
|
# 2. Remove any old untracked files (including stale cache)
|
||||||
|
git clean -fd
|
||||||
|
|
||||||
|
# 3. Verify no cache files exist
|
||||||
|
ls -la .sysref* 2>&1
|
||||||
|
|
||||||
|
# 4. Run fresh - cache will be built automatically
|
||||||
|
bash launcher.sh --detect-only
|
||||||
|
```
|
||||||
|
|
||||||
### After Git Pull
|
### After Git Pull
|
||||||
```bash
|
```bash
|
||||||
# 1. Update code from git
|
# 1. Update code from git
|
||||||
cd /root/server-toolkit-beta
|
cd /root/server-toolkit-beta
|
||||||
git pull origin dev
|
git pull origin dev
|
||||||
|
|
||||||
# 2. Clear old cache
|
# 2. Remove any untracked files from previous versions
|
||||||
bash launcher.sh --clear-cache
|
git clean -fd
|
||||||
|
|
||||||
# 3. Verify detection works
|
# 3. Verify detection works (cache auto-clears if launcher.sh changed)
|
||||||
bash launcher.sh --detect-only
|
bash launcher.sh --detect-only
|
||||||
|
|
||||||
# 4. Run normally
|
# 4. Run normally
|
||||||
|
|||||||
+7
-2
@@ -692,13 +692,18 @@ startup_detection() {
|
|||||||
# Auto-clear cache if toolkit files are newer (fresh git pull)
|
# Auto-clear cache if toolkit files are newer (fresh git pull)
|
||||||
# This ensures users always get fresh data after git updates
|
# This ensures users always get fresh data after git updates
|
||||||
if [ -f "$BASE_DIR/.sysref.beta" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
|
if [ -f "$BASE_DIR/.sysref.beta" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
|
||||||
# If launcher.sh is newer than cache, it means git just pulled updates
|
|
||||||
# and we should rebuild cache with current code
|
|
||||||
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref.beta" ]; then
|
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref.beta" ]; then
|
||||||
rm -f "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref.beta.timestamp" 2>/dev/null || true
|
rm -f "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref.beta.timestamp" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Also check production cache name for backward compatibility
|
||||||
|
if [ -f "$BASE_DIR/.sysref" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
|
||||||
|
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref" ]; then
|
||||||
|
rm -f "$BASE_DIR/.sysref" "$BASE_DIR/.sysref.timestamp" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Initialize system detection first (required for show_system_overview)
|
# Initialize system detection first (required for show_system_overview)
|
||||||
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then
|
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then
|
||||||
initialize_system_detection
|
initialize_system_detection
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ build_reference_database() {
|
|||||||
echo " - $db_count databases"
|
echo " - $db_count databases"
|
||||||
echo " - $domain_count domains"
|
echo " - $domain_count domains"
|
||||||
echo " - $wp_count WordPress sites"
|
echo " - $wp_count WordPress sites"
|
||||||
echo " - $total_lines total entries"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_system_section() {
|
build_system_section() {
|
||||||
|
|||||||
Reference in New Issue
Block a user