Skip to content
Snippets Groups Projects
Commit 4e809967 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Reinstall packages when restarting setup (refs #27851).

parent 4ba14474
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import subprocess
import utils
def setup(interactive=True):
cmds = [
'apt-get install -y python3-mediaserver-monitor',
]
utils.run_commands(cmds)
# Set ubicast password if any
pwd = utils.get_conf('MONITOR_SHELL_PWD')
if pwd:
p = subprocess.Popen(['passwd', '-q', 'msmonitor'], stdin=subprocess.PIPE)
p.communicate(input=b'%(pwd)s\n%(pwd)s' % {b'pwd': pwd.encode('utf-8')})
if p.returncode != 0:
raise Exception('Failed to set msmonitor account password.')
utils.log('\033[1;33m The msmonitor account password has been set. \033[0m')
#!/bin/bash
source /root/envsetup/global-conf.sh
# MS package install
if ( dpkg -s python3-mediaserver-monitor >/dev/null 2>&1 ); then
DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall python3-mediaserver-monitor
else
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mediaserver-monitor
fi
if [[ "${MONITOR_SHELL_PWD}" != "" ]]; then
echo -e "${MONITOR_SHELL_PWD}\n${MONITOR_SHELL_PWD}" | passwd -q msmonitor
echo -e "\033[1;33mThe msmonitor account password has been set.\033[0m"
fi
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
source /root/envsetup/global-conf.sh source /root/envsetup/global-conf.sh
# MS package install # MS package install
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mediaserver if ( dpkg -s python3-mediaserver >/dev/null 2>&1 ); then
DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall python3-mediaserver
else
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-mediaserver
fi
# set sender address # set sender address
sender="${EMAIL_SENDER}" sender="${EMAIL_SENDER}"
......
...@@ -3,7 +3,11 @@ source /root/envsetup/global-conf.sh ...@@ -3,7 +3,11 @@ source /root/envsetup/global-conf.sh
if ( apt-cache madison campus-manager | grep "campus-manager | " ); then if ( apt-cache madison campus-manager | grep "campus-manager | " ); then
# install cm # install cm
apt-get install -y campus-manager if ( dpkg -s campus-manager >/dev/null 2>&1 ); then
DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall campus-manager
else
DEBIAN_FRONTEND=noninteractive apt-get install -y campus-manager
fi
# configure nginx # configure nginx
sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf sed -i "s@server_name skyreach;@server_name ${CM_SERVER_NAME};@" /etc/nginx/sites-available/skyreach.conf
service nginx restart service nginx restart
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment