Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
openwrt-packages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feed
openwrt-packages
Commits
6606f74b
Commit
6606f74b
authored
4 years ago
by
Lejla Murselovic
Browse files
Options
Downloads
Patches
Plain Diff
ksmbd: introduce more parameters to uci config
parent
5deb76eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/ksmbd-tools/files/ksmbd.init
+30
-1
30 additions, 1 deletion
net/ksmbd-tools/files/ksmbd.init
with
30 additions
and
1 deletion
net/ksmbd-tools/files/ksmbd.init
+
30
−
1
View file @
6606f74b
...
@@ -27,16 +27,29 @@ smb_header()
...
@@ -27,16 +27,29 @@ smb_header()
local hostname
local hostname
hostname
=
"
$(
cat
/proc/sys/kernel/hostname
)
"
hostname
=
"
$(
cat
/proc/sys/kernel/hostname
)
"
local
max_active_sessions
local
tcp_port
local
restrict_anonymous
config_get workgroup
$1
workgroup
"WORKGROUP"
config_get workgroup
$1
workgroup
"WORKGROUP"
config_get description
$1
description
"Ksmbd on OpenWrt"
config_get description
$1
description
"Ksmbd on OpenWrt"
config_get_bool ALLOW_LEGACY_PROTOCOLS
$1
allow_legacy_protocols 0
config_get_bool ALLOW_LEGACY_PROTOCOLS
$1
allow_legacy_protocols 0
config_get max_active_sessions
$1
max_active_sessions
config_get tcp_port
$1
tcp_port
config_get restrict_anonymous
$1
restrict_anonymous
sed
-e
"s#|NAME|#
$hostname
#g"
\
sed
-e
"s#|NAME|#
$hostname
#g"
\
-e
"s#|WORKGROUP|#
$workgroup
#g"
\
-e
"s#|WORKGROUP|#
$workgroup
#g"
\
-e
"s#|DESCRIPTION|#
$description
#g"
\
-e
"s#|DESCRIPTION|#
$description
#g"
\
-e
"s#|INTERFACES|#
$interfaces
#g"
\
-e
"s#|INTERFACES|#
$interfaces
#g"
\
/etc/ksmbd/smb.conf.template
>
/var/etc/ksmbd/smb.conf
/etc/ksmbd/smb.conf.template
>
/var/etc/ksmbd/smb.conf
{
[
-n
"
$max_active_sessions
"
]
&&
printf
"
\t
max active sessions = %s
\n
"
"
$max_active_sessions
"
[
-n
"
$tcp_port
"
]
&&
printf
"
\t
tcp port = %s
\n
"
"
$tcp_port
"
[
-n
"
$restrict_anonymous
"
]
&&
printf
"
\t
restrict anonymous = %s
\n
"
"
$restrict_anonymous
"
}
>>
/var/etc/ksmbd/smb.conf
{
{
printf
"
\n
######### Dynamic written config options #########
\n
"
printf
"
\n
######### Dynamic written config options #########
\n
"
...
@@ -74,6 +87,11 @@ smb_add_share()
...
@@ -74,6 +87,11 @@ smb_add_share()
local
inherit_owner
local
inherit_owner
local
force_create_mode
local
force_create_mode
local
force_directory_mode
local
force_directory_mode
local
max_connections
local
invalid_users
local
hosts_allow
local
hosts_deny
local
valid_users
config_get name
$1
name
config_get name
$1
name
config_get path
$1
path
config_get path
$1
path
...
@@ -93,6 +111,11 @@ smb_add_share()
...
@@ -93,6 +111,11 @@ smb_add_share()
config_get inherit_owner
$1
inherit_owner
config_get inherit_owner
$1
inherit_owner
config_get force_create_mode
$1
force_create_mode
config_get force_create_mode
$1
force_create_mode
config_get force_directory_mode
$1
force_directory_mode
config_get force_directory_mode
$1
force_directory_mode
config_get max_connections
$1
max_connections
config_get invalid_users
$1
invalid_users
config_get hosts_allow
$1
hosts_allow
config_get hosts_deny
$1
hosts_deny
config_get valid_users
$1
valid_users
[
-z
"
$name
"
]
||
[
-z
"
$path
"
]
&&
return
[
-z
"
$name
"
]
||
[
-z
"
$path
"
]
&&
return
...
@@ -124,6 +147,12 @@ smb_add_share()
...
@@ -124,6 +147,12 @@ smb_add_share()
[
-n
"
$hide_dot_files
"
]
&&
printf
"
\t
hide dot files = %s
\n
"
"
$hide_dot_files
"
[
-n
"
$hide_dot_files
"
]
&&
printf
"
\t
hide dot files = %s
\n
"
"
$hide_dot_files
"
[
-n
"
$veto_files
"
]
&&
printf
"
\t
veto files = %s
\n
"
"
$veto_files
"
[
-n
"
$veto_files
"
]
&&
printf
"
\t
veto files = %s
\n
"
"
$veto_files
"
[
-n
"
$max_connections
"
]
&&
printf
"
\t
max connections = %s
\n
"
"
$max_connections
"
[
-n
"
$invalid_users
"
]
&&
printf
"
\t
invalid users = %s
\n
"
"
$invalid_users
"
[
-n
"
$hosts_allow
"
]
&&
printf
"
\t
hosts allow = %s
\n
"
"
$hosts_allow
"
[
-n
"
$hosts_deny
"
]
&&
printf
"
\t
hosts_deny = %s
\n
"
"
$hosts_deny
"
[
-n
"
$valid_users
"
]
&&
printf
"
\t
valid users = %s
\n
"
"
$valid_users
"
}
>>
/var/etc/ksmbd/smb.conf
}
>>
/var/etc/ksmbd/smb.conf
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment