diff --git a/imageroot/actions/restore-module/06copyenv b/imageroot/actions/restore-module/06copyenv new file mode 100755 index 00000000..3094e3a0 --- /dev/null +++ b/imageroot/actions/restore-module/06copyenv @@ -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]) diff --git a/imageroot/actions/restore-module/60systemd b/imageroot/actions/restore-module/60systemd new file mode 100755 index 00000000..f37070a9 --- /dev/null +++ b/imageroot/actions/restore-module/60systemd @@ -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