Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
a9efd5bc
Commit
a9efd5bc
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Line matching
parent
5ca98a20
No related branches found
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-addsipuser
+6
-6
6 additions, 6 deletions
src/freedombone-addsipuser
src/freedombone-rmsipuser
+3
-3
3 additions, 3 deletions
src/freedombone-rmsipuser
with
9 additions
and
9 deletions
src/freedombone-addsipuser
+
6
−
6
View file @
a9efd5bc
...
...
@@ -45,7 +45,7 @@ function show_help {
function
sip_user_exists
{
IFS
=
''
while
read
line
;
do
if
[[
"
$line
"
==
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
if
[[
"
$line
"
==
*
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
USER_EXISTS
=
"yes"
return
fi
...
...
@@ -62,17 +62,17 @@ function update_sip_user {
IFS
=
''
while
read
line
;
do
if
[
!
$USER_FOUND
]
;
then
if
[[
"
$line
"
==
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
if
[[
"
$line
"
==
*
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
USER_FOUND
=
"yes"
fi
else
if
[[
"
$line
"
==
"<extension>"
*
]]
;
then
if
[[
"
$line
"
==
*
"<extension>"
*
]]
;
then
line
=
"<extension>
$EXTENSION
</extension>"
fi
if
[[
"
$line
"
==
"<secret>"
*
]]
;
then
if
[[
"
$line
"
==
*
"<secret>"
*
]]
;
then
line
=
"<secret>
$PASSWORD
</secret>"
fi
if
[[
"
$line
"
==
"<display>"
*
]]
;
then
if
[[
"
$line
"
==
*
"<display>"
*
]]
;
then
line
=
"<display>
$MY_USERNAME
$EXTENSION
</display>"
USER_FOUND
=
fi
...
...
@@ -90,7 +90,7 @@ function add_sip_user {
touch
$NEW_CONFIG_FILE
IFS
=
''
while
read
line
;
do
if
[[
"
$line
"
==
'</provision>'
]]
;
then
if
[[
"
$line
"
==
*
'</provision>'
]]
;
then
echo
"<user id=
\"
$MY_USERNAME
\"
>"
>>
$NEW_CONFIG_FILE
echo
"<extension>
$EXTENSION
</extension>"
>>
$NEW_CONFIG_FILE
echo
"<secret>
$PASSWORD
</secret>"
>>
$NEW_CONFIG_FILE
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-rmsipuser
+
3
−
3
View file @
a9efd5bc
...
...
@@ -43,7 +43,7 @@ function show_help {
function
sip_user_exists
{
IFS
=
''
while
read
line
;
do
if
[[
"
$line
"
==
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
if
[[
"
$line
"
==
*
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
USER_EXISTS
=
"yes"
return
fi
...
...
@@ -60,14 +60,14 @@ function remove_sip_user {
IFS
=
''
while
read
line
;
do
if
[
!
$USER_FOUND
]
;
then
if
[[
"
$line
"
==
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
if
[[
"
$line
"
==
*
"<user id=
\"
$MY_USERNAME
\"
>"
]]
;
then
USER_FOUND
=
"yes"
fi
fi
if
[
!
$USER_FOUND
]
;
then
echo
"
$line
"
>>
$NEW_CONFIG_FILE
else
if
[[
"
$line
"
==
'</user>'
]]
;
then
if
[[
"
$line
"
==
*
'</user>'
]]
;
then
USER_FOUND
=
fi
fi
...
...
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