Skip to content

Commit

Permalink
api.restore-module
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 28, 2023
1 parent 3e1b043 commit e72115a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions imageroot/actions/restore-module/06copyenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3

#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#

import sys
import json
import agent

request = json.load(sys.stdin)

original_environment = request['environment']

for evar in [
"MAIL_SERVER",
"MAIL_HOSTNAME"
]:
agent.set_env(evar, original_environment[evar])
14 changes: 14 additions & 0 deletions imageroot/actions/restore-module/60systemd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#

set -e

# Redirect any output to the journal (stderr)
exec 1>&2

# Enable and start the service
systemctl --user enable --now imapsync.service

0 comments on commit e72115a

Please sign in to comment.