File: //var/packages/WordPress/scripts/start-stop-status
#!/bin/bash
# Copyright (c) 2000-2017 Synology Inc. All rights reserved.
. "$(dirname "$0")"/common
ExistSynoInc()
{
grep -q "Synology Inc" "$1"
}
RemoveLegacyHtaccess()
{
local htaccess_path="$WEBSITE_ROOT/.htaccess"
local htaccess_syno_path="$WEBSITE_ROOT/.htaccess.syno"
# remove legacy synology .htaccess for redirecting to disabled.html
if [ -e "$htaccess_syno_path" ]; then
if ExistSynoInc "$htaccess_syno_path"; then
rm -f "$htaccess_syno_path"
else
mv "$htaccess_syno_path" "$htaccess_path"
fi
fi
if [ -e "$htaccess_path" ]; then
if ExistSynoInc "$htaccess_path"; then
rm -f "$htaccess_path"
fi
fi
# remove lagacy disabled.html
local disabled_html="$WEBSITE_ROOT/disabled.html"
if [ -f $disabled_html ]; then
rm $disabled_html
fi
}
StartDaemons()
{
CustomStart
if [ ! -d "$WEBSITE_ROOT" ]; then
echo "web_packages/$PKG_DIR not found." > "$SYNOPKG_TEMP_LOGFILE"
exit 150
fi
RemoveLegacyHtaccess
}
StopDaemons()
{
CustomStop
}
case "$1" in
start)
StartDaemons
;;
stop)
StopDaemons
;;
status)
if [ ! -d "$WEBSITE_ROOT" ]; then
rm -f "$PKG_DESKTOP"
exit 150
fi
exit 0
;;
log)
echo ""
;;
*)
echo "Usage: $0 {start|stop|status}" >&2
exit 1
;;
esac
exit 0