Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
adf38d92
Commit
adf38d92
authored
Dec 07, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename add_group to add_groupto and write real add_group scripd
parent
c1af50ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
add_group.sh
dc/add_group.sh
+33
-1
add_groupto.sh
dc/add_groupto.sh
+6
-0
No files found.
dc/add_group.sh
View file @
adf38d92
#!/bin/bash
samba-tool group addmembers
"
$1
"
"
$2
"
# Written by Vitaly Lipatov <lav@etersoft.ru> (c) 2012, 2017
# TODO
NISDOMAIN
=
etersoft
# TODO:
# get last group ID
# getent group | cut -d":" -f3 | sort -n
fatal
()
{
echo
"
$*
"
>
&2
exit
1
}
FORCE
=
if
[
"
$1
"
=
"--force"
]
;
then
FORCE
=
1
shift
fi
RGROUP
=
"
$1
"
[
-n
"
$RGROUP
"
]
||
fatal
"Run with group name arg"
if
[
-n
"
$FORCE
"
]
;
then
samba-tool group delete
"
$RGROUP
"
fi
RGID
=
"
$2
"
[
-n
"
$RGID
"
]
||
fatal
"Can't get gid for
$RGROUP
(sec arg)"
samba-tool group add
"
$RGROUP
"
--gid-number
=
"
$RGID
"
--nis-domain
=
"
$NISDOMAIN
"
dc/add_groupto.sh
0 → 100755
View file @
adf38d92
#!/bin/bash
# group user
GROUP
=
"
$1
"
shift
samba-tool group addmembers
"
$GROUP
"
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment