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
c4f02011
Commit
c4f02011
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
about
parent
4a9b267a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-controlpanel
+110
-16
110 additions, 16 deletions
src/freedombone-controlpanel
with
110 additions
and
16 deletions
src/freedombone-controlpanel
+
110
−
16
View file @
c4f02011
...
...
@@ -114,23 +114,117 @@ function add_user {
fi
}
function
show_sip_extensions
{
if
[
!
-f
$SIP_CONFIG_FILE
]
;
then
return
;
function
show_domains
{
echo
'Domains'
echo
'======='
echo
''
if
grep
-q
"Email onion domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Email \t'
echo
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Email onion domain'
|
awk
-F
':'
'{print $2}'
)
"
fi
clear
echo
$"SIP phone extensions:"
echo
" "
while
read
ext
;
do
if
[[
$ext
==
*
"user id"
*
]]
;
then
echo
-n
" "
echo
-n
$(
echo
"
$ext
"
|
awk
-F
'"'
'{print $2}'
|
awk
-F
'"'
'{print $1}'
)
echo
-n
" "
if
grep
-q
"Wiki domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Wiki \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Wiki domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_wiki
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_wiki/hostname
)
"
fi
echo
''
fi
if
grep
-q
"Hubzilla domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Hubzilla \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Hubzilla domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_hubzilla
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_hubzilla/hostname
)
"
fi
echo
''
fi
if
grep
-q
"Blog domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Blog \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Blog domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_blog
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_blog/hostname
)
"
fi
echo
''
fi
if
grep
-q
"GNU Social domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'GNU Social\t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'GNU Social domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_microblog
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_microblog/hostname
)
"
fi
echo
''
fi
if
grep
-q
"Owncloud domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Owncloud \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Owncloud domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_owncloud
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_owncloud/hostname
)
"
fi
echo
''
fi
if
grep
-q
"Gogs domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'Gogs \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'Gogs domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_git
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_gogs/hostname
)
"
fi
echo
''
fi
if
grep
-q
"XMPP domain"
$COMPLETION_FILE
;
then
echo
-n
-e
'XMPP \t'
echo
-n
"
$(
cat
${
COMPLETION_FILE
}
|
grep
'XMPP domain'
|
awk
-F
':'
'{print $2}'
)
"
echo
-n
-e
'\t'
if
[
-d
/var/lib/tor/hidden_service_xmpp
]
;
then
echo
-n
"
$(
cat
/var/lib/tor/hidden_service_xmpp/hostname
)
"
fi
if
[[
$ext
==
*
"extension"
*
]]
;
then
echo
$(
echo
"
$ext
"
|
awk
-F
'>'
'{print $2}'
|
awk
-F
'<'
'{print $1}'
)
echo
''
fi
echo
''
}
function
show_users
{
echo
'Users'
echo
'====='
echo
''
for
d
in
/home/
*
/
;
do
USRNAME
=
$(
echo
"
$d
"
|
awk
-F
'/'
'{print $3}'
)
if
[[
$USRNAME
!=
"git"
]]
;
then
echo
-n
"
$USERNAME
"
# get the SIP extension
SIPEXT
=
while
read
ext
;
do
if
[[
$ext
==
*
"user id"
*
]]
;
then
CURR_UID
=
$(
echo
"
$ext
"
|
awk
-F
'"'
'{print $2}'
|
awk
-F
'"'
'{print $1}'
)
fi
if
[[
$ext
==
*
"extension"
*
]]
;
then
if
[[
$CURR_UID
==
$USRNAME
]]
;
then
SIPEXT
=
$(
echo
"
$ext
"
|
awk
-F
'>'
'{print $2}'
|
awk
-F
'<'
'{print $1}'
)
fi
fi
done
<
$SIP_CONFIG_FILE
echo
-e
-n
'\t'
if
[
$SIPEXT
]
;
then
echo
-n
"SIP:
${
SIPEXT
}
"
fi
# size of the home directory
echo
-e
-n
'\t'
echo
-n
"
$(
du
-s
-h
/home/
${
USRNAME
}
|
awk
-F
' '
'{print $1}'
)
"
echo
''
fi
done
<
$SIP_CONFIG_FILE
done
}
function
show_about
{
show_domains
show_users
any_key
}
...
...
@@ -1242,7 +1336,7 @@ function menu_top_level {
--title
$"Control Panel"
\
--radiolist
$"Choose an operation:"
25 70 18
\
1
$"Backup and Restore"
off
\
2
$"
Show SIP Phone Extensions
"
off
\
2
$"
About this system
"
off
\
3
$"Reset Tripwire"
off
\
4
$"Logging on/off"
off
\
5
$"Ping enable/disable"
off
\
...
...
@@ -1266,7 +1360,7 @@ function menu_top_level {
esac
case
$(
cat
$data
)
in
1
)
menu_backup_restore
;;
2
)
show_
sip_extensions
;;
2
)
show_
about
;;
3
)
reset_tripwire
;;
4
)
logging_on_off
;;
5
)
ping_enable_disable
;;
...
...
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