asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T #!/bin/sh cd `dirname "$0"` . ./functions.sh if [ $? != 0 ]; then echo [ERROR] Can not include 'functions.sh'. exit 1 fi test_license() { COPY_LICENSE_KEY=1 if [ -f "$LSWS_HOME/conf/serial.no" ]; then if [ ! -f "$LSINSTALL_DIR/serial.no" ]; then cp "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no" else diff "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no" 1>/dev/null if [ $? -ne 0 ]; then COPY_LICENSE_KEY=0 fi fi fi # if [ $COPY_LICENSE_KEY -eq 1 ]; then # if [ -f "$LSWS_HOME/conf/license.key" ] && [ ! -f "$LSINSTALL_DIR/license.key" ]; then # cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key" # fi # if [ -f "$LSWS_HOME/conf/license.key" ] && [ -f "$LSINSTALL_DIR/license.key" ]; then # diff "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key" # if [ $? -ne 0 ]; then # cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key" # fi # fi # fi if [ -f "$LSINSTALL_DIR/license.key" ] && [ -f "$LSINSTALL_DIR/serial.no" ]; then echo "License key and serial number are available, testing..." echo bin/lshttpd -V if [ $? -eq 0 ]; then LICENSE_OK=1 if [ -f "$LSINSTALL_DIR/conf/license.key" ]; then mv "$LSINSTALL_DIR/conf/license.key" "$LSINSTALL_DIR/license.key" bin/lshttpd -t fi fi echo fi if [ "x$LICENSE_OK" = "x" ]; then if [ -f "$LSINSTALL_DIR/serial.no" ]; then # echo "Serial number is available." # printf "Would you like to register a license key for this server? [Y/n]" # read TMP_YN # echo "" # if [ "x$TMP_YN" = "x" ] || [ `expr "$TMP_YN" : '[Yy]'` -gt 0 ]; then echo "Contacting licensing server ..." echo "" $LSINSTALL_DIR/bin/lshttpd -r if [ $? -eq 0 ]; then echo "[OK] License key received." $LSINSTALL_DIR/bin/lshttpd -t if [ $? -eq 0 ]; then LICENSE_OK=1 else echo "The license key received does not work." fi fi # fi fi fi if [ "x$LICENSE_OK" = "x" ]; then if [ -f "$LSINSTALL_DIR/trial.key" ]; then $LSINSTALL_DIR/bin/lshttpd -t if [ $? -ne 0 ]; then exit 1 fi else cat <" "$LSWS_HOME/conf/httpd_config.xml"` OLD_CHROOT_PATH_CONF=`grep "" "$LSWS_HOME/conf/httpd_config.xml"` OLD_ENABLE_CHROOT=`expr "$OLD_ENABLE_CHROOT_CONF" : '.*\(.*\).*'` OLD_CHROOT_PATH=`expr "$OLD_CHROOT_PATH_CONF" : '[^<]*\([^<]*\).*'` if [ "x$OLD_ENABLE_CHROOT" != "x" ]; then ENABLE_CHROOT=$OLD_ENABLE_CHROOT fi if [ "x$OLD_CHROOT_PATH" != "x" ]; then CHROOT_PATH=$OLD_CHROOT_PATH fi fi CHANGE_CHROOT=0 if [ $INST_USER = "root" ]; then CHANGE_CHROOT=1 if [ $INSTALL_TYPE = "upgrade" ]; then CHANGE_CHROOT=0 if [ $ENABLE_CHROOT -eq 1 ]; then cat < $CHROOT_PATH/etc/passwd grep "$WS_GROUP" /etc/group > $CHROOT_PATH/etc/group fi fi cp $LSWS_HOME/conf/httpd_config.xml $LSWS_HOME/conf/httpd_config.xml.bak chown "$DIR_OWN" $LSWS_HOME/conf/httpd_config.xml.bak RES=`grep '' $LSWS_HOME/conf/httpd_config.xml.bak` if [ $? -eq 1 ]; then sed -e "s##$CHROOT_PATH$ENABLE_CHROOT#" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml" else sed -e "s#.*<\/chrootPath>#$CHROOT_PATH<\/chrootPath>#" -e "s/.*<\/enableChroot>/$ENABLE_CHROOT<\/enableChroot>/" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml" fi fi } installLicense() { if [ -f ./serial.no ]; then cp -f ./serial.no $LSWS_HOME/conf chown "$SDIR_OWN" $LSWS_HOME/conf/serial.no chmod "$DOC_MOD" $LSWS_HOME/conf/serial.no fi if [ -f ./license.key ]; then cp -f ./license.key $LSWS_HOME/conf chown "$SDIR_OWN" $LSWS_HOME/conf/license.key chmod "$CONF_MOD" $LSWS_HOME/conf/license.key fi if [ -f ./trial.key ]; then cp -f ./trial.key $LSWS_HOME/conf chown "$SDIR_OWN" $LSWS_HOME/conf/trial.key chmod "$DOC_MOD" $LSWS_HOME/conf/trial.key fi } portOffset() { SUCC=0 SEL=0 while [ $SUCC -eq "0" ]; do cat </dev/null` TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'` if [ "x$TST_USER" = "xapache" ]; then WS_USER=apache WS_GROUP=apache else WS_USER=www-data WS_GROUP=www-data # default PID FILE, source the real one, debian and ubuntu different APACHE_PID_FILE=/var/run/apache2/apache2.pid . /etc/apache2/envvars PANEL_VARY=".debian" fi ADMIN_PORT=7088 elif [ $SEL -eq "4" ]; then HOST_PANEL="hsphere" WS_USER=httpd WS_GROUP=httpd elif [ $SEL -eq "5" ]; then HOST_PANEL="interworx" WS_USER=apache WS_GROUP=apache elif [ $SEL -eq "6" ]; then HOST_PANEL="lxadminh" WS_USER=apache WS_GROUP=apache elif [ $SEL -eq "7" ]; then HOST_PANEL="ispmanager" WS_USER=apache WS_GROUP=apache fi fi DIR_OWN=$WS_USER:$WS_GROUP CONF_OWN=$WS_USER:$WS_GROUP else SUCC=1 fi done } LSINSTALL_DIR=`dirname "$0"` cd $LSINSTALL_DIR init license install_dir test_license admin_login if [ $INSTALL_TYPE = "reinstall" ]; then configAdminEmail if [ $INST_USER = "root" ]; then hostPanels fi if [ "x$HOST_PANEL" = "x" ]; then getUserGroup stopLshttpd getServerPort getAdminPort configRuby enablePHPHandler else hostPanelConfig fi fi if [ "x$HOST_PANEL" = "x" ]; then configChroot fi cat <