Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wdscripts
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
ifs
coast
wdscripts
Commits
5a6ef877
Commit
5a6ef877
authored
5 years ago
by
Marcel Huber
Browse files
Options
Downloads
Patches
Plain Diff
minor shellcheck based corrections
parent
0050a676
No related branches found
No related tags found
1 merge request
!3
major refactoring/cleanup of scripts
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bootScript.sh
+1
-0
1 addition, 0 deletions
bootScript.sh
stopwds.sh
+14
-13
14 additions, 13 deletions
stopwds.sh
with
15 additions
and
13 deletions
bootScript.sh
+
1
−
0
View file @
5a6ef877
...
...
@@ -71,6 +71,7 @@ bootScriptName=${derefd_name};
[
!
"
$bootScriptName
"
=
"bootScript.sh"
]
&&
{
echo
"This script cannot be sourced, aborting!"
;
exit
2
;
}
# load global config
# shellcheck source=./config.sh
.
$mypath
/config.sh
$cfg_dbgopt
my_uid
=
$(
getUid
)
...
...
This diff is collapsed.
Click to expand it.
stopwds.sh
+
14
−
13
View file @
5a6ef877
...
...
@@ -33,14 +33,12 @@ showhelp()
exit
4
;
}
cfg_dbgopt
=
""
;
cfg_cfgdir
=
""
;
cfg_dbg
=
0
;
PRINT_DBG
=
0
;
cfg_hardkill
=
0
;
cfg_waitcount
=
60
;
cfg_procname
=
""
;
locRunUser
=
""
;
cfg_forceStop
=
0
;
# process config switching options first
myPrgOptions
=
":C:N:U:w:FDK"
...
...
@@ -59,12 +57,11 @@ while getopts "${myPrgOptions}" opt; do
locRunUser
=
"
${
OPTARG
}
"
;
;;
F
)
cfg_forceStop
=
1
;
:
;;
D
)
# propagating this option to config.sh
cfg_dbgopt
=
"-D"
;
cfg_dbg
=
1
;
PRINT_DBG
=
1
;
;;
K
)
cfg_hardkill
=
1
;
...
...
@@ -85,20 +82,23 @@ if [ -n "$cfg_cfgdir" ]; then
fi
if
[
"
${
PRINT_DBG
:-
0
}
"
-ge
1
]
;
then
echo
" - sourcing config.sh"
;
fi
;
.
$mypath
/config.sh
$cfg_dbgopt
# shellcheck source=./config.sh
.
"
$mypath
"
/config.sh
MYNAME
=
$stopwdsScriptName
# used within trapsignalfuncs/serverfuncs for logging
# install signal handlers
.
$mypath
/trapsignalfuncs.sh
# shellcheck source=./trapsignalfuncs.sh
.
"
$mypath
"
/trapsignalfuncs.sh
# source server handling funcs
.
$mypath
/serverfuncs.sh
# shellcheck source=./serverfuncs.sh
.
"
$mypath
"
/serverfuncs.sh
myExit
()
{
locRetCode
=
${
1
:-
4
}
;
LogLeaveScript
${
locRetCode
}
exit
${
locRetCode
}
;
LogLeaveScript
"
${
locRetCode
}
"
exit
"
${
locRetCode
}
"
;
}
exitproc
()
...
...
@@ -112,10 +112,11 @@ exitproc()
myExit 0
;
}
outmsg
=
"Stopping
${
SERVERNAME
}
server"
;
LogEnterScript
outmsg
=
"Stopping
${
SERVERNAME
}
server"
;
printf
"%s"
"
${
outmsg
}
"
;
killStep
=
0
;
sigToSend
=
15
;
sigToSendName
=
"TERM"
;
...
...
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