x SuSE Linux 13.1-RELEASE x
x SuSE Linux 13.1-RELEASEx
SHARE(1) User Commands SHARE(1)
NAME
share - enable or disable a Samba share availability
SYNOPSIS
share {enable|disable} sharename
DESCRIPTION
share is a shell script designed to automate the process of toggling
the availability of a specific Samba share within the
/etc/samba/smb.conf configuration file.
The script modifies the available parameter within the specified share
section, setting it to yes for the enable action or no for the disable
action.
This script must be executed with superuser privileges (e.g., via
sudo).
ARGUMENTS
enable Sets the available parameter for the specified share to yes.
disable
Sets the available parameter for the specified share to no.
sharename
The name of the share section to be modified as defined in
/etc/samba/smb.conf.
BEHAVIOR
Configuration Management:
The script performs an in-place edit of /etc/samba/smb.conf. Be-
fore applying any changes, the script creates a backup of the
original configuration file with a ext{.bak} extension.
Validation:
The script verifies that the requested share exists within the
configuration file. After modification, it runs testparm to en-
sure the new configuration is syntactically valid. If the con-
figuration check fails, the script automatically reverts the
changes using the backup file.
Process Handling:
If the script detects that files within the share's defined path
are actively being accessed by other processes (via lsof), it
will display a warning. The user will be prompted to confirm
whether to force-disconnect these processes using fuser.
Service Reload:
Upon a successful configuration update and validation, the
script triggers a reload of the Samba configuration using smb-
control.
EXIT STATUS
Success. An error occurred (e.g., insufficient privileges, invalid ar-
guments, share not found, or configuration validation failure).
FILES
The primary Samba configuration file targeted by the script. The
backup of the configuration file created by the script prior to modifi-
cation.
SEE ALSO
smb.conf(5), testparm(1), smbcontrol(1)
1.0 2026-05-04 SHARE(1)
Want to link to this manual page? Use this URL:
<https://star2.abcm.com/cgi-bin/linux-man?query=share&sektion=1&manpath=>