seafile/scripts/reset-admin.sh

36 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
SCRIPT=$(readlink -f "$0")
INSTALLPATH=$(dirname "${SCRIPT}")
TOPDIR=$(dirname "${INSTALLPATH}")
default_ccnet_conf_dir=${TOPDIR}/ccnet
default_seafile_data_dir=${TOPDIR}/seafile-data
default_seahub_db=${TOPDIR}/seahub.db
function check_python_executable() {
if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
return 0
fi
if which python2.7 2>/dev/null 1>&2; then
PYTHON=python2.7
elif which python27 2>/dev/null 1>&2; then
PYTHON=python27
elif which python2.6 2>/dev/null 1>&2; then
PYTHON=python2.6
elif which python26 2>/dev/null 1>&2; then
PYTHON=python26
else
echo
echo "Can't find a python executable of version 2.6 or above in PATH"
echo "Install python 2.6+ before continue."
echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
echo
exit 1
fi
}
check_python_executable;
seahub_admin_py=${INSTALLPATH}/seahub/tools/seahub-admin.py
exec $PYTHON $seahub_admin_py $default_ccnet_conf_dir