echo "deleting deployed vm"
${DIRvim}/openvim vm-delete -f | grep -q deleted && sleep 10 #give some time to get virtual machines deleted
echo "Stopping openvim${screen_name_param}${openvim_param}"
- $DIRNAME/service-openvim.sh stop${screen_name_param}${openvim_param}
+ $DIRNAME/service-openvim stop${screen_name_param}${openvim_param}
echo "Initializing databases $db_name"
$DIRvim/database_utils/init_vim_db.sh -u vim -p vimpw -d $db_name
echo "Starting openvim${screen_name_param}${openvim_param}"
- $DIRNAME/service-openvim.sh start${screen_name_param}${openvim_param}
+ $DIRNAME/service-openvim start${screen_name_param}${openvim_param}
elif [[ $action == delete-all ]]
then
ln -s -v /opt/openvim/openvimd.cfg /etc/default/openvimd.cfg || echo "warning cannot create link '/etc/default/openvimd.cfg'"
ln -s -v /opt/openvim/logs /var/log/openvim || echo "warning cannot create link '/var/log/openvim'"
ln -s -v /opt/openvim/openvim /usr/bin/openvim
-ln -s -v /opt/openvim/scripts/service-openvim.sh /usr/sbin/service-openvim
-ln -s -v /opt/openvim/scripts/openvim-report.sh /usr/bin/openvim-report
+ln -s -v /opt/openvim/scripts/service-openvim /usr/sbin/service-openvim
+ln -s -v /opt/openvim/scripts/openvim-report /usr/bin/openvim-report
ln -s -v /opt/openvim/scripts/initopenvim.sh /usr/bin/initopenvim
ln -s -v /opt/openvim/openflow /usr/bin/openflow
[Service]
User=${USER_OWNER}
-ExecStart=/opt/openvim/openvimd.py -c /opt/openvim/openvimd.cfg --log-file=/opt/openvim/logs/openvim.log
+ExecStart=/opt/openvim/openvimd -c /opt/openvim/osm_openvim/openvimd.cfg --log-file=/opt/openvim/logs/openvim.log
Restart=always
[Install]
}
function db_exists() {
- RESULT=`mysqlshow --defaults-extra-file="$2" | grep -v Wildcard | grep -o $1`
+ RESULT=`mysqlshow --defaults-extra-file="$2" | grep -v Wildcard | grep -w $1`
if [ "$RESULT" == "$1" ]; then
echo " DB $1 exists"
return 0
fi
[[ -n "$FORCE" ]] && rm -rf $OPENVIM_BASEFOLDER #make idempotent
else
- HERE=$(realpath $(dirname $0))
+ HERE=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
OPENVIM_BASEFOLDER=$(dirname $HERE)
fi
done
fi
-
-if [ -z "$NO_DB" ]; then
- if [ -n "$QUIET_MODE" ]; then
- DB_QUIET='-q'
- fi
-
- echo "!!!! install-db-server.sh: ${OPENVIM_BASEFOLDER}/scripts/install-db-server.sh -u $DBUSER $DBPASSWD_PARAM -n vim_db $DB_QUIET"
- ${OPENVIM_BASEFOLDER}/scripts/install-db-server.sh -u $DBUSER $DBPASSWD_PARAM $DB_QUIET || exit 1
-fi
-
-
if [[ -z "$NO_PACKAGES" ]]
then
su $SUDO_USER -c "git clone ${GIT_URL} ${OPENVIM_BASEFOLDER}"
su $SUDO_USER -c "cp ${OPENVIM_BASEFOLDER}/.gitignore-common ${OPENVIM_BASEFOLDER}/.gitignore"
- [[ -z $DEVELOP ]] && su $SUDO_USER -c "git -C ${OPENVIM_BASEFOLDER} checkout tags/v1.0.2"
+ [[ -z $DEVELOP ]] && su $SUDO_USER -c "git -C ${OPENVIM_BASEFOLDER} checkout v2.0"
fi
+DB_QUIET=''
+if [ -z "$NO_DB" ]; then
+ if [ -n "$QUIET_MODE" ]; then
+ DB_QUIET='-q'
+ fi
+
+ echo "!!!! install-db-server.sh: ${OPENVIM_BASEFOLDER}/database_utils/install-db-server.sh -U $DBUSER $DBPASSWD_PARAM $DB_QUIET"
+ ${OPENVIM_BASEFOLDER}/database_utils/install-db-server.sh -U $DBUSER $DBPASSWD_PARAM $DB_QUIET || exit 1
+fi
if [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ]
su $SUDO_USER -c 'rm -f ${HOME}/bin/get_dhcp_lease.sh'
su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/openvim' "'${HOME}/bin/openvim'
su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/openflow' "'${HOME}/bin/openflow'
- su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-openvim.sh' "'${HOME}/bin/service-openvim'
- su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/initopenvim.sh' "'${HOME}/bin/initopenvim'
- su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-floodlight.sh' "'${HOME}/bin/service-floodlight'
- su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-opendaylight.sh' "'${HOME}/bin/service-opendaylight'
+ su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-openvim' "'${HOME}/bin/service-openvim'
+ su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/initopenvim' "'${HOME}/bin/initopenvim'
+ su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-floodlight' "'${HOME}/bin/service-floodlight'
+ su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/service-opendaylight' "'${HOME}/bin/service-opendaylight'
su $SUDO_USER -c "ln -s '${OPENVIM_BASEFOLDER}/scripts/get_dhcp_lease.sh' "'${HOME}/bin/get_dhcp_lease.sh'
#insert /home/<user>/bin in the PATH