Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LCS-primtux
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Primtux-SLIS
LCS-primtux
Commits
b370727f
Verified
Commit
b370727f
authored
7 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Better deploy and reset
parent
c4ecffff
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy.sh
+8
-19
8 additions, 19 deletions
deploy.sh
post-smb-config
+28
-0
28 additions, 0 deletions
post-smb-config
reset.sh
+43
-0
43 additions, 0 deletions
reset.sh
with
79 additions
and
19 deletions
deploy.sh
+
8
−
19
View file @
b370727f
#!/bin/bash
usage
(){
echo
"Usage
$0
NbMaxconnections"
echo
"Set the LCS maximum number of samba connection to NbMaxconnections"
}
# Copyright (C) 2018 Tetras Libre <Contact@Tetras-Libre.fr>
# Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
...
...
@@ -23,23 +19,16 @@ usage(){
if
[[
!
"
`
hostname
`
"
=
~
"lcs"
]]
then
echo
"This script should be run on the LCS"
usage
exit
1
fi
if
[
-z
"
$1
"
]
DIR
=
`
dirname
$0
`
if
[
-f
"/usr/local/sbin/post-smb-config"
]
&&
\
[
!
-f
"/usr/local/sbin/post-smb-config"
]
then
usage
exit
1
cp
/usr/local/sbin/post-smb-config /usr/local/sbin/post-smb-config.old
fi
DIR
=
`
dirname
$0
`
# Update lcs-smb-config then run it to force max connections to 1
set
-x
awk
"BEGIN{PRINT=1;FOUND=0}
\
/^[
\"
;]*
$/
{if(IN){IN=0;if(FOUND==0){print
\"\t
max connections =
$1
\"
;FOUND=1}}}
\
/^
\[
homes
\]
/{IN=1} /max connections/{if(IN){FOUND=1;PRINT=0; print
\"\t
max connections =
$1
\"
}}
\
{if(PRINT){print
\$
0};PRINT=1}"
\
/usr/share/lcs/sbin/lcs-smb-config
>
/usr/share/lcs/sbin/lcs-smb-config.new
cp
/usr/share/lcs/sbin/lcs-smb-config.new /usr/share/lcs/sbin/lcs-smb-config
/usr/share/lcs/sbin/lcs-smb-config
cp
$DIR
/post-smb-config /usr/local/sbin/post-smb-config
/usr/local/sbin/post-smb-config
service samba restart
This diff is collapsed.
Click to expand it.
post-smb-config
0 → 100644
+
28
−
0
View file @
b370727f
#!/bin/bash
# Copyright (C) 2018 Tetras Libre <Contact@Tetras-Libre.fr>
# Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
awk
"BEGIN{PRINT=1;FOUND=0}
\
/^
$/
{if(IN){IN=0;if(FOUND==0){print
\"\t
max connections = 1
\"
;FOUND=1}}}
\
/^
\[
homes
\]
/{IN=1} /max connections/{if(IN){FOUND=1;PRINT=0; print
\"\t
max connections = 1
\"
}}
\
{if(PRINT){print
\$
0};PRINT=1}"
\
/etc/samba/smb.conf
>
/etc/samba/smb.conf.new
if
[
!
-f
"/etc/samba/smb.conf.old"
]
then
cp
/etc/samba/smb.conf /etc/samba/smb.conf.old
fi
mv
/etc/samba/smb.conf.new /etc/samba/smb.conf
This diff is collapsed.
Click to expand it.
reset.sh
0 → 100644
+
43
−
0
View file @
b370727f
#!/bin/bash
# Copyright (C) 2018 Tetras Libre <Contact@Tetras-Libre.fr>
# Author: Beniamine, David <David.Beniamine@Tetras-Libre.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if
[[
!
"
`
hostname
`
"
=
~
"lcs"
]]
then
echo
"This script should be run on the LCS"
exit
1
fi
DIR
=
`
dirname
$0
`
if
[
-f
"/usr/local/sbin/post-smb-config.old"
]
then
cp
/usr/local/sbin/post-smb-config.old /usr/local/sbin/post-smb-config
else
rm
/usr/local/sbin/post-smb-config
fi
awk
"BEGIN{PRINT=1;FOUND=0}
\
/^
$/
{if(IN){IN=0;if(FOUND==0){print
\"\t
max connections = 30
\"
;FOUND=1}}}
\
/^
\[
homes
\]
/{IN=1} /max connections/{if(IN){FOUND=1;PRINT=0; print
\"\t
max connections = 30
\"
}}
\
{if(PRINT){print
\$
0};PRINT=1}"
\
/etc/samba/smb.conf
>
/etc/samba/smb.conf.new
if
[
!
-f
"/etc/samba/smb.conf.old"
]
then
cp
/etc/samba/smb.conf /etc/samba/smb.conf.old
fi
mv
/etc/samba/smb.conf.new /etc/samba/smb.conf
service samba restart
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