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
814bd711
Commit
814bd711
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
logging command
parent
7238d90a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+4
-0
4 additions, 0 deletions
Makefile
man/freedombone-logging.1.gz
+0
-0
0 additions, 0 deletions
man/freedombone-logging.1.gz
src/freedombone-controlpanel
+9
-3
9 additions, 3 deletions
src/freedombone-controlpanel
src/freedombone-logging
+76
-0
76 additions, 0 deletions
src/freedombone-logging
with
89 additions
and
3 deletions
Makefile
+
4
−
0
View file @
814bd711
...
...
@@ -40,6 +40,7 @@ install:
install
-m
755 src/
${
APP
}
-meshweb
${
DESTDIR
}${
PREFIX
}
/bin/meshweb
install
-m
755 src/
${
APP
}
-controlpanel
${
DESTDIR
}${
PREFIX
}
/bin
install
-m
755 src/
${
APP
}
-controlpanel
${
DESTDIR
}${
PREFIX
}
/bin/control
install
-m
755 src/
${
APP
}
-logging
${
DESTDIR
}${
PREFIX
}
/bin
mkdir
-m
755
-p
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-keydrive
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
...
...
@@ -66,6 +67,7 @@ install:
install
-m
644 man/
${
APP
}
-xmpp-pass
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-mesh
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-controlpanel
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
install
-m
644 man/
${
APP
}
-logging
.1.gz
${
DESTDIR
}${
PREFIX
}
/share/man/man1
uninstall
:
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-keydrive
.1.gz
...
...
@@ -92,6 +94,7 @@ uninstall:
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-xmpp-pass
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-mesh
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-controlpanel
.1.gz
rm
-f
${
PREFIX
}
/share/man/man1/
${
APP
}
-logging
.1.gz
rm
-rf
${
PREFIX
}
/share/
${
APP
}
rm
-f
${
PREFIX
}
/bin/
${
APP
}
rm
-f
${
PREFIX
}
/bin/zeronetavahi
...
...
@@ -121,6 +124,7 @@ uninstall:
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-meshweb
rm
-f
${
PREFIX
}
/bin/meshweb
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-controlpanel
rm
-f
${
PREFIX
}
/bin/
${
APP
}
-logging
clean
:
rm
-f
\#
*
\.
#* debian/*.substvars debian/*.log
rm
-fr
deb.
*
debian/
${
APP
}
...
...
This diff is collapsed.
Click to expand it.
man/freedombone-logging.1.gz
0 → 100644
+
0
−
0
View file @
814bd711
File added
This diff is collapsed.
Click to expand it.
src/freedombone-controlpanel
+
9
−
3
View file @
814bd711
...
...
@@ -313,6 +313,10 @@ function restore_data_remote {
any_key
}
function
logging_on_off
{
and_key
}
function
restore_gpg_key
{
select_user
if
[
!
$SELECTED_USERNAME
]
;
then
...
...
@@ -331,7 +335,7 @@ function menu_top_level {
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
"Freedombone Control Panel"
\
--title
"Control Panel"
\
--radiolist
"Choose an operation:"
2
2
70 15
\
--radiolist
"Choose an operation:"
2
4
70 15
\
1
"Backup data to USB drive"
off
\
2
"Restore data from USB drive"
off
\
3
"Restore from remote backup"
off
\
...
...
@@ -346,7 +350,8 @@ function menu_top_level {
12
"Backup GPG key to USB drive (master keydrive)"
off
\
13
"Backup GPG key to USB drive (fragment keydrive)"
off
\
14
"Restore GPG key from USB drive"
off
\
15
"Exit"
on 2>
$data
15
"Turn logging on/off"
off
\
16
"Exit"
on 2>
$data
sel
=
$?
case
$sel
in
1
)
exit
1
;;
...
...
@@ -367,7 +372,8 @@ function menu_top_level {
12
)
create_keydrive_master
;;
13
)
create_keydrive_fragment
;;
14
)
restore_gpg_key
;;
15
)
break
;;
15
)
logging_on_off
;;
16
)
break
;;
esac
done
}
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-logging
0 → 100755
+
76
−
0
View file @
814bd711
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# Turn logging on or off
# License
# =======
#
# Copyright (C) 2015 Bob Mottram <bob@robotics.uk.to>
#
# 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
[
!
"
$1
"
]
;
then
exit
1
fi
if
[[
"
$1
"
==
"on"
||
"
$1
"
==
"On"
||
"
$1
"
==
"ON"
]]
;
then
if
[
-d
/etc/nginx
]
;
then
for
filename
in
/etc/nginx/sites-available/
*
;
do
filename_domain
=
$(
echo
"
$filename
"
|
awk
-F
'/'
'{print $5}'
)
sed
-i
's|access_log.*|access_log /var/log/nginx/$filename_domain.access.log;|g'
$filename
sed
-i
's|warn_log.*|warn_log /var/log/nginx/$filename_domain.warn.log;|g'
$filename
sed
-i
"s|error_log.*|error_log /var/log/nginx/
$filename_domain
.err.log;|g"
$filename
done
fi
if
[
-f
/etc/init.d/spamassassin
]
;
then
sed
-i
's|DOPTIONS="-s null -d --pidfile=$PIDFILE"|DOPTIONS="-d --pidfile=$PIDFILE"|g'
/etc/init.d/spamassassin
fi
if
[
-d
/etc/prosody
]
;
then
sed
-i
's|info = "/dev/null";|info = "/var/log/prosody/prosody.log";|g'
/etc/prosofy/prosody.cfg.lua
sed
-i
's|error = "/dev/null";|error = "/var/log/prosody/prosody.err";|g'
/etc/prosofy/prosody.cfg.lua
fi
else
if
[
-d
/etc/nginx
]
;
then
for
filename
in
/etc/nginx/sites-available/
*
;
do
sed
-i
's|access_log.*|access_log off;|g'
$filename
sed
-i
's|warn_log.*|warn_log off;|g'
$filename
sed
-i
's|error_log.*|error_log off;|g'
$filename
done
fi
if
[
-f
/etc/init.d/spamassassin
]
;
then
sed
-i
's|DOPTIONS="-d --pidfile=$PIDFILE"|DOPTIONS="-s null -d --pidfile=$PIDFILE"|g'
/etc/init.d/spamassassin
fi
if
[
-d
/etc/prosody
]
;
then
sed
-i
's|info = "/var/log/prosody/prosody.log";|info = "/dev/null";|g'
/etc/prosofy/prosody.cfg.lua
sed
-i
's|error = "/var/log/prosody/prosody.err";|error = "/dev/null";|g'
/etc/prosofy/prosody.cfg.lua
fi
fi
if
[
-d
/etc/nginx
]
;
then
service php5-fpm restart
service nginx restart
fi
if
[
-f
/etc/init.d/spamassassin
]
;
then
service spamassassin restart
fi
exit
0
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