File: //var/packages/ScsiTarget/scripts/start-stop-status
#!/bin/bash
# Copyright (c) 2000-2019 Synology Inc. All rights reserved.
. /var/packages/${SYNOPKG_PKGNAME}/scripts/pkg_utils
start()
{
# If in the SHA safe mode
if /usr/syno/sbin/synohacore --is_ha_running; then
if /usr/local/bin/synoha --is-safemode; then
return 0
fi
fi
${SYNOSCSITPKG_UPDATER} "webapi_ready"
/usr/syno/bin/synosystemctl start pkg-iscsi
if [ "$?" -ne "0" ]; then
return 1
fi
${SYNOSCSITPKG_UPDATER} "service_ready"
return $?
}
stop()
{
/usr/syno/bin/synosystemctl stop pkg-iscsi
return $?
}
status()
{
if [ -e ${PKG_APP_LINK_PATH} ]; then
return 0
else
return 1
fi
}
case $1 in
start)
start
exit $?
;;
stop)
stop
exit 0
;;
status)
status
exit $?
;;
killall)
;;
log)
exit 0
;;
esac
exit 0