echo "Refreshing systemd configurations ..."
systemctl daemon-reload

echo "Checking the status of the ss-tproxy service ..."
if systemctl is-active --quiet ss-tproxy.service; then
 echo "Restarting ss-tproxy service ..."
 systemctl try-restart ss-tproxy.service
elif systemctl is-enabled --quiet ss-tproxy.service; then
 echo "Starting ss-tproxy service ..."
 systemctl start ss-tproxy.service || true
else
 echo "Skipping ss-tproxy service ..."
fi
