revert update smarttms.service pure--ftpd.config dcp
This commit is contained in:
zj
2025-12-02 01:28:22 +08:00
parent 1c26e23603
commit 5f078f0027
8 changed files with 26 additions and 411 deletions

View File

@@ -1 +0,0 @@
/home/smart/.config/systemd/user/smarttms.service

View File

@@ -1,22 +0,0 @@
[Unit]
Description=SmartTMS Service (User)
After=mysqld.service graphical.target
Wants=mysqld.service
[Service]
Type=forking
ExecStart=sudo /usr/bin/smarttms start
ExecStop=sudo /usr/bin/smarttms stop
ExecReload=sudo /usr/bin/smarttms restart
Restart=on-failure
RestartSec=5
TimeoutStartSec=300
TimeoutStopSec=300
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/smart/.Xauthority"
Environment="XDG_CURRENT_DESKTOP=XFCE"
[Install]
WantedBy=default.target

View File

@@ -1,68 +0,0 @@
#!/bin/bash
# ==============================================================================
# FFmpeg Wrapper Script for Volume Detection
#
# This script acts as a wrapper for the real ffmpeg binary.
# It's designed to handle cases where 'ffmpeg -filter:a volumedetect'
# doesn't output 'mean_volume:' (e.g., for image files or videos without audio).
#
# If 'mean_volume:' is not found in the real ffmpeg's stderr output,
# it injects 'mean_volume: 0 dB' into the stderr stream.
#
# Setup:
# 1. Rename your original ffmpeg binary.
# Example: mv /usr/bin/ffmpeg /usr/bin/ffmpeg.bin
# 2. Place this script at the original ffmpeg's path.
# Example: cp this_script.sh /usr/bin/ffmpeg
# 3. Make this script executable.
# Example: chmod +x /usr/bin/ffmpeg
# 4. Ensure REAL_FFMPEG_BINARY points to your renamed ffmpeg binary.
# ==============================================================================
# --- Configuration ---
# Point this to the actual ffmpeg binary after you've renamed it.
# For example: /usr/bin/ffmpeg.bin or /usr/local/bin/ffmpeg.bin
REAL_FFMPEG_BINARY="/usr/bin/ffmpeg.bin"
# ---------------------
# Check if the real ffmpeg binary exists
if [ ! -f "$REAL_FFMPEG_BINARY" ]; then
echo "Error: Real ffmpeg binary not found at $REAL_FFMPEG_BINARY" >&2
echo "Please ensure you've renamed your original ffmpeg (e.g., to ffmpeg.bin)" >&2
echo "and updated the REAL_FFMPEG_BINARY path in this script." >&2
exit 1
fi
# Create a temporary file to capture stderr from the real ffmpeg command
TEMP_ERR_FILE=$(mktemp)
# Ensure the temporary file is deleted when the script exits
trap "rm -f $TEMP_ERR_FILE" EXIT
# Execute the real ffmpeg with all arguments passed to this script.
# Redirect its stdout to /dev/null as volumedetect output is on stderr.
# Redirect its stderr to our temporary file.
"$REAL_FFMPEG_BINARY" "$@" >/dev/null 2>"$TEMP_ERR_FILE"
# Capture the exit code of the real ffmpeg command
REAL_FFMPEG_EXIT_CODE=$?
# Read the content of the temporary stderr file
FFMPEG_STDERR_CONTENT=$(cat "$TEMP_ERR_FILE")
# Check if "mean_volume:" is present in the captured stderr content
if echo "$FFMPEG_STDERR_CONTENT" | grep -q "mean_volume:"; then
# If found, print the original stderr content to our stderr
echo "$FFMPEG_STDERR_CONTENT" >&2
else
# If not found, print the original stderr content
echo "$FFMPEG_STDERR_CONTENT" >&2
# Then inject the default mean_volume line
echo "[ffmpeg-wrapper] Injected: mean_volume: 0 dB (original output lacked volume info)" >&2 # For debugging
echo "mean_volume: 0 dB" >&2
fi
# Exit with the same exit code as the real ffmpeg command
exit $REAL_FFMPEG_EXIT_CODE