Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
# Define IPs OLD_IP="172.16.1.227" NEW_IP="172.16.1.229" CONF_FILE="/etc/rsyslog.d/99-remotelog.conf" if [ -f "$CONF_FILE" ]; then echo "[+] Updating config from $OLD_IP to $NEW_IP..." # 1. Update the IP address sudo sed -i "s/$OLD_IP/$NEW_IP/g" "$CONF_FILE" # 2. Restart the service echo "[+] Restarting rsyslog..." sudo systemctl restart rsyslog # 3. Validation if grep -q "$NEW_IP" "$CONF_FILE"; then echo "[SUCCESS] Config updated." # Send a test log to the new server logger "MIGRATION_TEST: Hello 172.16.1.229 from $(hostname)" echo "[+] Test log sent. Check /var/log/syslog on the new server." else echo "[FAIL] Update failed. Check file permissions." fi else echo "[-] Config file $CONF_FILE not found. Run the setup script first!" fi
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)