This commit is contained in:
github-actions[bot] 2021-05-09 19:08:28 +00:00
parent 82cc3966ef
commit e1207b213f
10 changed files with 3 additions and 149 deletions

View File

@ -1,36 +0,0 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autosamba
PKG_VERSION:=1
PKG_RELEASE:=12
include $(INCLUDE_DIR)/package.mk
define Package/autosamba
TITLE:=Samba autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-samba4 +wsdd2
PKGARCH:=all
endef
define Package/autosamba/description
A hotplug script to config Samba share automatically.
endef
define Build/Compile
true
endef
define Package/autosamba/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/20-smb $(1)/etc/hotplug.d/block/20-smb
endef
$(eval $(call BuildPackage,autosamba))

View File

@ -1,104 +0,0 @@
#!/bin/sh
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
. /lib/functions.sh
. /lib/functions/service.sh
global=0
config_file="/etc/config/samba"
wait_for_init() {
for i in `seq 30`
do
[ -e /tmp/procd.done ] || {
sleep 1; continue;
}
return
done
}
smb_handle() {
config_get path $1 path
if [ "$path" = "$2" ] ;then
global=1
fi
}
chk_en() {
config_get_bool autoshare $1 autoshare 1
[ $autoshare -eq 0 ] && exit
}
config_load samba
config_foreach chk_en samba
device=`basename $DEVPATH`
case "$ACTION" in
add)
case "$device" in
sd*) ;;
md*) ;;
hd*);;
mmcblk*);;
*) return;;
esac
path="/dev/$device"
wait_for_init
cat /proc/mounts | while read j
do
str=${j%% *}
if [ "$str" == $path ];then
strr=${j#* }
target=${strr%% *}
global=0
config_foreach smb_handle sambashare $target
name=${target#*/mnt/}
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig sambashare" >> $config_file
echo -e "\toption auto '1'" >> $config_file
echo -e "\toption name '$name'" >> $config_file
echo -e "\toption path '$target'" >> $config_file
echo -e "\toption read_only 'no'" >> $config_file
echo -e "\toption guest_ok 'yes'" >> $config_file
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
/etc/init.d/samba reload
return
fi
fi
done
;;
remove)
i=0
while true
do
dev=`uci get samba.@sambashare[$i].device`
[ $? -ne 0 ] && break
[ "$dev" = "$device" ] && {
auto=`uci get samba.@sambashare[$i].auto`
[ $auto = "1" ] && {
mount_dir=`uci get samba.@sambashare[$i].name`
uci delete samba.@sambashare[$i]
uci commit
/etc/init.d/samba reload
return
}
}
let i+=1
done
;;
esac

View File

@ -1,5 +1,5 @@
#!/bin/sh /etc/rc.common
START=50
START=15
NAME="cpufreq"

View File

@ -1,5 +1,3 @@
diff --git a/src/jconf.c b/src/jconf.c
index 710f70d..1613e20 100644
--- a/src/jconf.c
+++ b/src/jconf.c
@@ -259,6 +259,19 @@ read_jconf(const char *file)
@ -22,19 +20,15 @@ index 710f70d..1613e20 100644
} else {
match = 0;
}
diff --git a/src/redir.c b/src/redir.c
index feafd5e..64521a1 100644
--- a/src/redir.c
+++ b/src/redir.c
@@ -1252,7 +1252,10 @@ main(int argc, char **argv)
@@ -1252,6 +1252,9 @@ main(int argc, char **argv)
if (user == NULL) {
user = conf->user;
}
- if (mtu == 0) {
+ if (mode == TCP_ONLY) {
+ mode = conf->mode;
+ }
+ if (mtu == 0) {
if (mtu == 0) {
mtu = conf->mtu;
}
if (mptcp == 0) {