summaryrefslogtreecommitdiffstats
path: root/odl-pipeline/lib/odl_reinstaller.sh
blob: a55f16c8439d05f3b3c4fc69d3bfe5d92fa83817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Copyright (c) 2017 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
set -e
export PYTHONPATH=$PYTHONPATH:$DIR
mkdir -p $DIR/tmp
cd $DIR
cat > opendaylight.service << EOF
[Unit]
Description=OpenDaylight SDN Controller
Documentation=https://wiki.opendaylight.org/view/Main_Page http://www.opendaylight.org/
After=network.service

[Service]
Type=forking
ExecStart=/opt/opendaylight/bin/start
Environment=_JAVA_OPTIONS='-Djava.net.preferIPv4Stack=true'
User=odl
Group=odl
SuccessExitStatus=143
LimitNOFILE=102400
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
curl --fail --silent -L -O http://artifacts.opnfv.org/apex/random/aaa-cli-jar.jar
python ./odl_reinstaller/odl_reinstaller.py $@