HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //usr/syno/lib/systemd/scripts/synocacheadvisord-clean-up.sh
#! /bin/bash

SERVICE_NAME=synocacheadvisord.service
ADVISOR_TOOL=/usr/syno/sbin/synocacheadvisor

service_result=$(systemctl show -p Result $SERVICE_NAME | awk -F '=' '{print $2}')
service_status=$(systemctl show -p ExecMainStatus $SERVICE_NAME | awk -F '=' '{print $2}')

# exit-code -1(255) implies internal error / load fail, in both cases no need to cleanup
if [ ! "$service_result" = "success" ] && ! { [ "$service_result" = "exit-code" ] && [ "$service_status" = "255" ]; }; then
	$ADVISOR_TOOL --clean-up
fi