NEEDED_PACKAGES="$1"
echo -e "Checking required packages: ${NEEDED_PACKAGES}"
for PACKAGE in ${NEEDED_PACKAGES} ; do
- dpkg -L ${PACKAGE} &>/dev/null
+ dpkg -L ${PACKAGE}
if [ $? -ne 0 ]; then
- echo -e "Package ${PACKAGE} is not installed. Updating apt"
+ echo -e "Package ${PACKAGE} is not installed."
+ echo -e "Updating apt-cache ..."
sudo apt-get update
+ echo -e "Installing ${PACKAGE} ..."
sudo apt-get install -y ${PACKAGE} || FATAL "failed to install ${PACKAGE}"
fi
done
function install_osm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+
+ trap ctrl_c INT
+ track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
+
track checks checkingroot_ok
[ "$USER" == "root" ] && FATAL "You are running the installer as root. The installer is prepared to be executed as a normal user with sudo privileges."
track checks noroot_ok
DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
[ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
- DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'`
+ DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]; exit}'`
[ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
# configure apt proxy
# if no host is passed in, we need to install lxd/juju, unless explicilty asked not to
if [ -z "$OSM_VCA_HOST" ] && [ -z "$INSTALL_NOLXD" ] && [ -z "$LXD_CLOUD_FILE" ]; then
- check_packages "snapd"
install_lxd
fi
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
+function ctrl_c() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ echo "** Trapped CTRL-C"
+ FATAL "User stopped the installation"
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
LXD_VERSION=4.0
JUJU_VERSION=2.9
-JUJU_AGENT_VERSION=2.9.17
+JUJU_AGENT_VERSION=2.9.22
UNINSTALL=""
DEVELOP=""
UPDATE=""
# if develop, we force master
[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
-check_packages "git wget curl tar"
+check_packages "git wget curl tar snapd"
sudo snap install jq
if [ -z "$OSM_DEVOPS" ]; then
#Installation starts here
wget -q -O- https://osm-download.etsi.org/ftp/osm-11.0-eleven/README.txt &> /dev/null
export OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
-
-track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
-
install_osm
echo -e "\nDONE"
exit 0
-