Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mailinabox
Commits
6194c63f
Commit
6194c63f
authored
Jun 05, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add management comments for checking for updated Ubuntu packages and applying updates
parent
cab7321d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
daemon.py
management/daemon.py
+15
-1
No files found.
management/daemon.py
View file @
6194c63f
#!/usr/bin/python3
#!/usr/bin/python3
import
os
,
os
.
path
import
os
,
os
.
path
,
subprocess
from
flask
import
Flask
,
request
,
render_template
from
flask
import
Flask
,
request
,
render_template
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
...
@@ -55,6 +55,20 @@ def dns_update():
...
@@ -55,6 +55,20 @@ def dns_update():
from
dns_update
import
do_dns_update
from
dns_update
import
do_dns_update
return
do_dns_update
(
env
)
return
do_dns_update
(
env
)
# System
@
app
.
route
(
'/system/updates'
)
def
show_updates
():
subprocess
.
check_call
(
"apt-get -qq update"
,
shell
=
True
)
return
subprocess
.
check_output
(
r"""apt-get -qq -s upgrade | grep -v ^Conf | sed "s/^Inst /Updated Package Available: /" | sed "s/\[\(.*\)\] (\(\S*\).*/\(\1 => \2\)/" """
,
shell
=
True
)
@
app
.
route
(
'/system/update-packages'
,
methods
=
[
"POST"
])
def
do_updates
():
subprocess
.
check_call
(
"apt-get -qq update"
,
shell
=
True
)
return
subprocess
.
check_output
(
"DEBIAN_FRONTEND=noninteractive apt-get -y upgrade"
,
shell
=
True
)
# APP
# APP
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment