samba.sh better sed delimiter
This commit is contained in:
parent
bec2314716
commit
5d29bb0f64
4
samba.sh
4
samba.sh
@ -87,7 +87,7 @@ user() { local name="${1}" passwd="${2}"
|
|||||||
# workgroup) the name to set
|
# workgroup) the name to set
|
||||||
# Return: configure the correct workgroup
|
# Return: configure the correct workgroup
|
||||||
workgroup() { local workgroup="${1}" file=/etc/samba/smb.conf
|
workgroup() { local workgroup="${1}" file=/etc/samba/smb.conf
|
||||||
sed -i 's/^\( *workgroup = \).*/\1'"$workgroup"'/' $file
|
sed -i 's|^\( *workgroup = \).*|\1'"$workgroup"'|' $file
|
||||||
}
|
}
|
||||||
|
|
||||||
### usage: Help
|
### usage: Help
|
||||||
@ -133,7 +133,7 @@ while getopts ":hi:ns:t:u:w:" opt; do
|
|||||||
n) NMBD="true" ;;
|
n) NMBD="true" ;;
|
||||||
s) eval share $(sed 's/^\|$/"/g; s/;/" "/g' <<< $OPTARG) ;;
|
s) eval share $(sed 's/^\|$/"/g; s/;/" "/g' <<< $OPTARG) ;;
|
||||||
t) timezone "$OPTARG" ;;
|
t) timezone "$OPTARG" ;;
|
||||||
u) eval user $(sed 's/;/ /g' <<< $OPTARG) ;;
|
u) eval user $(sed 's|;| |g' <<< $OPTARG) ;;
|
||||||
w) workgroup "$OPTARG" ;;
|
w) workgroup "$OPTARG" ;;
|
||||||
"?") echo "Unknown option: -$OPTARG"; usage 1 ;;
|
"?") echo "Unknown option: -$OPTARG"; usage 1 ;;
|
||||||
":") echo "No argument value for option: -$OPTARG"; usage 2 ;;
|
":") echo "No argument value for option: -$OPTARG"; usage 2 ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user