Added -n option to onos-install to suppress running ONOS via upstart daemon.
Showing
1 changed file
with
16 additions
and
6 deletions
| ... | @@ -6,8 +6,17 @@ | ... | @@ -6,8 +6,17 @@ |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults | 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | 8 | ||
| 9 | -# If the first option is -f attempt uninstall first. | 9 | +while getopts fn o; do |
| 10 | -[ "$1" = "-f" ] && shift && onos-uninstall ${1:-$OCI} | 10 | + case "$o" in |
| 11 | + f) uninstall=true;; | ||
| 12 | + n) nostart=true;; | ||
| 13 | + esac | ||
| 14 | +done | ||
| 15 | +let OPC=$OPTIND-1 | ||
| 16 | +shift $OPC | ||
| 17 | + | ||
| 18 | +# If the -f was given, attempt uninstall first. | ||
| 19 | +[ -n "$uninstall" ] && onos-uninstall ${1:-$OCI} | ||
| 11 | 20 | ||
| 12 | node=${1:-$OCI} | 21 | node=${1:-$OCI} |
| 13 | remote=$ONOS_USER@$node | 22 | remote=$ONOS_USER@$node |
| ... | @@ -27,19 +36,20 @@ ssh $remote " | ... | @@ -27,19 +36,20 @@ ssh $remote " |
| 27 | mkdir $ONOS_INSTALL_DIR/config | 36 | mkdir $ONOS_INSTALL_DIR/config |
| 28 | 37 | ||
| 29 | # Install the upstart configuration file and setup options for debugging | 38 | # Install the upstart configuration file and setup options for debugging |
| 30 | - sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf | 39 | + [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf |
| 31 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options | 40 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options |
| 32 | 41 | ||
| 33 | # Remove any previous ON.Lab bits from ~/.m2 repo | 42 | # Remove any previous ON.Lab bits from ~/.m2 repo |
| 34 | rm -fr ~/.m2/repository/org/onlab | 43 | rm -fr ~/.m2/repository/org/onlab |
| 35 | 44 | ||
| 36 | # Drop log level for the console | 45 | # Drop log level for the console |
| 37 | - echo "log4j.logger.org.apache.sshd = WARN" >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg | 46 | + echo "log4j.logger.org.apache.sshd = WARN" \ |
| 47 | + >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg | ||
| 38 | 48 | ||
| 39 | " | 49 | " |
| 40 | 50 | ||
| 41 | # Configure the ONOS installation | 51 | # Configure the ONOS installation |
| 42 | onos-config $node | 52 | onos-config $node |
| 43 | 53 | ||
| 44 | -# Ignite the ONOS service. | 54 | +# Unless -n option was given, attempt to ignite the ONOS service. |
| 45 | -onos-service $node start | 55 | +[ -z "$nostart" ] && onos-service $node start | ... | ... |
-
Please register or login to post a comment