# pkg_add -v -r sqlite3-3.7.17_1.tbz
# cd etc/rc.d
# pwd
/etc/rc.d
# touch webfm
# chmod 775 webfm
# chown magicband webfm
# cat > webfm
#!/bin/sh
# Part of NAS4Free (http://www.nas4free.org).
# Copyright (C) 2012 NAS4Free Team <info@nas4free.org>.
# All rights reserved.
#
# Portions of freenas (http://www.freenas.org).
# Copyright (C) 2005-2011 Olivier Cochard-Labbe <olivier@freenas.org>.
# Copyright (c) 2007-2009 Volker Theile <votdev@gmx.de>.
# All rights reserved.
#
# PROVIDE: webfm
# REQUIRE: DAEMON
. /etc/rc.subr
. /etc/configxml.subr
name="webfm"
load_rc_config "$name"
# Defaults
webfm_configdir=${webfm_configdir:-"/usr/local/www/ajaxplorer/server/users/"}
webfm_htusers=${webfm_htusers:-"${webfm_configdir}/.htusers.php"}
webfm_user_permissions=${webfm_user_permissions:-"0"}
webfm_user_active=${webfm_user_active:-"1"}
echo "Preparing web-based file-management."
# Generate the .htusers.php file containing the user configuration
echo '<?php $GLOBALS["users"]=array(' > ${webfm_htusers}
# Disable File Manager
if [ `configxml_get_count "//system/disablefm"` -gt 0 ]; then
echo ');?>' >> ${webfm_htusers}
exit 0;
fi
# Iterate over all configured users
_index=`configxml_get_count "//access/user"`
while [ ${_index} -gt 0 ]
do
_password=`configxml_get "//access/user[${_index}]/password"`
_password_md5=`/sbin/md5 -q -s "${_password}"`
_homedir=`configxml_get "//access/user[${_index}]/homedir"`
[ -z "${_homedir}" ] && _homedir=/mnt
/usr/local/bin/xml sel -t -m "//access/user[${_index}]" \
-v "concat('array(\"',login,'\",\"${_password_md5}\",\"${_homedir}\",\"http://localhost\",0,\"^.ht\",${webfm_user_permissions},${webfm_user_active}),')" \
${configxml_file} | /usr/local/bin/xml unesc >> ${webfm_htusers}
_index=$(( ${_index} - 1 ))
done
# Add administrator and root account
_password=`configxml_get "//system/password"`
_password_md5=`/sbin/md5 -q -s "${_password}"`
/usr/local/bin/xml sel -t -m "//system" \
-v "concat('array(\"',username,'\",\"${_password_md5}\",\"/\",\"http://localhost\",1,\"\",7,1),')" -n \
-o "array(\"root\",\"${_password_md5}\",\"/\",\"http://localhost\",1,\"\",7,1)," \
${configxml_file} | /usr/local/bin/xml unesc >> ${webfm_htusers}
echo ');?>' >> ${webfm_htusers}
# cd /usr/local/www
# pkg_add -v -r ajaxplorer-5.0.2.tbz
# setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.2-release/All/
# pkg_add -r php5-extensions
# pkg_add -r php5-xmlrpc
# pkg_add -r php5-gettext
# pkg_add -r php5-mcrypt
# pkg_add -r php5-mbstring
# pkg_add -r php5-zip
# pkg_add -r php5-gd
# pkg_add -r php5-zlib
# pkg_add -r php5-openssl
# pkg_add -r php5-pdo_mysql
# pkg_add -r php5-mysql
# pkg_add -r php5-mysqli
# pkg_add -r php5-pgsql
# pkg_add -r php5-pdo_pgsql
# pkg_add -r php5-ftp
# cd etc/rc.d# /etc/rc.d/webfm**/ some of your error messages have been reported on your screen but you don't need to worry about such a thing.you can assess your webserver. /**