HEX
Server: Apache
System: Linux viper.innovativeinternet.net 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
User: thetradingroom (1095)
PHP: 8.3.25
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //ibin/snincrease2
#!/bin/bash

filename="$1"

if [ -z "$filename" ]; then
    echo "Usage: $0 <filename>"
    exit 1
fi

# Find the last two digits of the existing serial number
last_two_digits=$(sed -n -E '/^\s*([0-9]+)\s*;\s*Serial Number/ s/^\s*([0-9]+)\s*;\s*Serial Number/\1/p' "$filename")

# Increment the last two digits
new_last_two_digits=$((10#$last_two_digits + 1))

# Replace the existing serial number line with the new one
sed -i -E "s/^\s*([0-9]+)\s*;\s*Serial Number/$(printf "%*s" $(grep -o '^\s*' "$filename" | wc -L) ' ')$new_last_two_digits ;Serial Number/" "$filename"