File: //etc.defaults/init/dsmupdate.conf
description "Synology dsm update"
start on (startup and (started syslog-ng or stopped syslog-ng))
task
console log
pre-start script
# only run dsm update when upgrade or migrate
if [ ! -f "/var/.UpgradeBootup" -o ! -f "/.old_patch_info/VERSION" ]; then
stop; exit 0
fi
# Do not configupdate again for bootup-smallupdate reboot
if [ -f "/var/.AutoSmallupdateBootup" ]; then
echo "skip configupdate for bootup-smallupdate reboot" || true
stop; exit 0
fi
end script
script
## check is migrate or upgrade
if [ -f "/.updater" ]; then
ACTION="MIGRATE"
TYPE="migrate"
else
ACTION="UPGRADE"
TYPE="upgrade"
fi
## run updater to handle update config task
## which require condition is root fs ready
/usr/syno/bin/configupdate -c rootfs_ready -t $TYPE -p /.old_patch_info/VERSION || true
if [ -x "/usr/syno/bin/configupdate.small" ]; then
/usr/syno/bin/configupdate.small -c rootfs_ready -p /.old_patch_info/VERSION || true
fi
## get normal upgrade info
OLD_MAJOR=`/bin/get_key_value /.old_patch_info/VERSION majorversion` || true
OLD_MINOR=`/bin/get_key_value /.old_patch_info/VERSION minorversion` || true
OLD_BUILDNUMBER=`/bin/get_key_value /.old_patch_info/VERSION buildnumber` || true
OLD_VERSION="${OLD_MAJOR}.${OLD_MINOR}"
export ACTION=$ACTION
export OLD_MAJOR=$OLD_MAJOR
export OLD_MINOR=$OLD_MINOR
export OLD_VERSION=$OLD_VERSION
export OLD_BUILDNUMBER=$OLD_BUILDNUMBER
/usr/syno/sbin/install_backup_plugin.sh
end script
# vim:ft=upstart