-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup-license
executable file
·51 lines (42 loc) · 1.31 KB
/
setup-license
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#
# Copyright (c) 2020-2024 IAR Systems AB
#
# setup-license
# License configuration for the bx-docker images
#
# See LICENSE for detailed license information
#
function _bx_show_help()
{
echo "Usage: ${BASH_SOURCE[0]} iarsystems/bx<image>:<tag> <iar-license-server-ip>"
echo "Example:"
echo " ${BASH_SOURCE[0]} iarsystems/bxarm:9.60.2 iar-license-server.corp.com"
echo " "
}
function _bx-license-setup()
{
if [ $# -ne 2 ]; then
_bx_show_help
return 1
fi
printf -- "-- setup-license: Creating a Docker volume for storing persistent license information...\n"
docker volume create LMS2 2>&1 > /dev/null
printf -- "-- setup-license: Running a container for setting up the license...\n"
docker run \
--quiet \
--rm \
--detach \
--tty \
--volume LMS2:/usr/local/etc/IARSystems \
--name bx-license-setup \
${1} 2>&1 > /dev/null
PACKAGE_DIR=$(docker exec bx-license-setup find /opt/iarsystems -type l)
printf -- "-- setup-license: Setting up the license with IAR Light License Manager...\n"
docker exec bx-license-setup ${PACKAGE_DIR}/common/bin/lightlicensemanager setup -s ${2} 2>&1 > /dev/null
printf -- "-- setup-license: Finished.\n"
docker stop bx-license-setup 2>&1 >/dev/null
}
_bx-license-setup $@
unset -f _bx-license-setup
unset -f _bx_show_help