HEX
Server: Apache/2.4.63 (Unix)
System: Linux Synopilou92 4.4.302+ #72806 SMP Mon Jul 21 23:16:00 CST 2025 x86_64
User: pilou92 (1026)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /volume1/@appstore/WebStation/tools/webstation_docker_event.sh
#!/bin/bash

if [ -z "$1" ]; then
    echo "Usage: $0 event_data [json]"
    exit -1
fi


category=$(jq -r .Type <<< $1)
action=$(jq -r .Action <<< $1)

if [ $category == 'network' ] && [ $action == 'connect' ]; then
	container=$(jq -er .Actor.Attributes.container <<< $1)
	if [ $? -eq 0 ]; then
		/var/packages/WebStation/target/tools/synowebservice docker check-sync "$container"
		if [ $? -eq 0 ]; then
			/var/packages/WebStation/target/tools/synowebservice service sync
			/var/packages/WebStation/target/tools/synowebservice portal reload-backend
		fi
	fi
fi