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: //var/packages/SynologyApplicationService/scripts/postinst
#!/bin/sh

. /var/packages/SynologyApplicationService/scripts/utils
. /var/packages/SynologyApplicationService/scripts/db_functions

SetupFn()
{
	cp $DEFAULT_SETTINGS_PATH $SETTINGS_PATH

	SynoSetVolume
	if [ ! -d "$(SynoSettingsGet volume)" ]; then
		return 1
	fi

	return 0
}

if ! SetupFn ; then
	exit 1
fi

if ! IsSASServiceRunningNode; then
	exit 0
fi

if [ ! -z $1 ]; then
	if [[ $1 == "--BackupSCIMDB" ]]; then
		BackupSCIMDB $2
		exit 0
	fi
	if [[ $1 == "--RestoreSCIMDB" ]]; then
		RestoreSCIMDB $2
		exit 0
	fi
	if [[ $1 == "--DropSCIMDB" ]]; then
		DropSCIMSchema
		exit 0
	fi
fi

if ! MigrateSettings || ! CreateSchema || ! UpdateSchema; then
	exit 1
fi

exit 0