diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index 5bb5645..6e8ca05 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -1589,12 +1589,14 @@ add_disable_wpcron_to_config() { # Try to insert before WordPress stop editing comment (proper convention) if grep -q "$WP_CONFIG_MARKER" "$wp_config" 2>/dev/null; then - # Use sed with @ delimiter to avoid escaping issues, insert before marker - sed -i.wpbak "@$WP_CONFIG_MARKER@i\\$new_define" "$wp_config" + # Use sed with proper newline syntax for insert command + sed -i.wpbak "/$WP_CONFIG_MARKER/i\\ +$new_define" "$wp_config" return 0 elif grep -q "$WP_EDIT_START" "$wp_config"; then # Fallback: if no stop editing found, add after opening PHP tag - sed -i.wpbak "@$WP_EDIT_START@a\\$new_define" "$wp_config" + sed -i.wpbak "/$WP_EDIT_START/a\\ +$new_define" "$wp_config" return 0 else # File format is unexpected