Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | #!/bin/echo ERROR: This script needs to be sourced. Please run as . |
| 2 | |
| 3 | # toaster - shell script to start Toaster |
| 4 | |
| 5 | # Copyright (C) 2013-2015 Intel Corp. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 7 | # SPDX-License-Identifier: GPL-2.0-or-later |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | # |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | HELP=" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 11 | Usage 1: source toaster start|stop [webport=<address:port>] [noweb] [nobuild] [toasterdir] |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | Optional arguments: |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | [nobuild] Setup the environment for capturing builds with toaster but disable managed builds |
| 14 | [noweb] Setup the environment for capturing builds with toaster but don't start the web server |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 15 | [webport] Set the development server (default: localhost:8000) |
Brad Bishop | 5dd7cbb | 2018-09-05 22:26:40 -0700 | [diff] [blame] | 16 | [toasterdir] Set absolute path to be used as TOASTER_DIR (default: BUILDDIR/../) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | Usage 2: source toaster manage [createsuperuser|lsupdates|migrate|makemigrations|checksettings|collectstatic|...] |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 18 | " |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | custom_extention() |
| 21 | { |
| 22 | custom_extension=$BBBASEDIR/lib/toaster/orm/fixtures/custom_toaster_append.sh |
| 23 | if [ -f $custom_extension ] ; then |
| 24 | $custom_extension $* |
| 25 | fi |
| 26 | } |
| 27 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | databaseCheck() |
| 29 | { |
| 30 | retval=0 |
| 31 | # you can always add a superuser later via |
| 32 | # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME> |
| 33 | $MANAGE migrate --noinput || retval=1 |
| 34 | |
| 35 | if [ $retval -eq 1 ]; then |
| 36 | echo "Failed migrations, aborting system start" 1>&2 |
| 37 | return $retval |
| 38 | fi |
| 39 | # Make sure that checksettings can pick up any value for TEMPLATECONF |
| 40 | export TEMPLATECONF |
| 41 | $MANAGE checksettings --traceback || retval=1 |
| 42 | |
| 43 | if [ $retval -eq 1 ]; then |
| 44 | printf "\nError while checking settings; aborting\n" |
| 45 | return $retval |
| 46 | fi |
| 47 | |
| 48 | return $retval |
| 49 | } |
| 50 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | webserverKillAll() |
| 52 | { |
| 53 | local pidfile |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 54 | if [ -f ${BUILDDIR}/.toastermain.pid ] ; then |
| 55 | custom_extention web_stop_postpend |
| 56 | else |
| 57 | custom_extention noweb_stop_postpend |
| 58 | fi |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 59 | for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | if [ -f ${pidfile} ]; then |
| 61 | pid=`cat ${pidfile}` |
| 62 | while kill -0 $pid 2>/dev/null; do |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 63 | kill -SIGTERM $pid 2>/dev/null |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 64 | sleep 1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | done |
| 66 | rm ${pidfile} |
| 67 | fi |
| 68 | done |
| 69 | } |
| 70 | |
| 71 | webserverStartAll() |
| 72 | { |
| 73 | # do not start if toastermain points to a valid process |
| 74 | if ! cat "${BUILDDIR}/.toastermain.pid" 2>/dev/null | xargs -I{} kill -0 {} ; then |
| 75 | retval=1 |
| 76 | rm "${BUILDDIR}/.toastermain.pid" |
| 77 | fi |
| 78 | |
| 79 | retval=0 |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 80 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 81 | # check the database |
| 82 | databaseCheck || return 1 |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 83 | |
| 84 | echo "Starting webserver..." |
| 85 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 86 | $MANAGE runserver --noreload "$ADDR_PORT" \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 87 | </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \ |
| 88 | & echo $! >${BUILDDIR}/.toastermain.pid |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 89 | |
| 90 | sleep 1 |
| 91 | |
| 92 | if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then |
| 93 | retval=1 |
| 94 | rm "${BUILDDIR}/.toastermain.pid" |
| 95 | else |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 96 | echo "Toaster development webserver started at http://$ADDR_PORT" |
| 97 | echo -e "\nYou can now run 'bitbake <target>' on the command line and monitor your build in Toaster.\nYou can also use a Toaster project to configure and run a build.\n" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 98 | custom_extention web_start_postpend $ADDR_PORT |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 99 | fi |
| 100 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | return $retval |
| 102 | } |
| 103 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 104 | INSTOPSYSTEM=0 |
| 105 | |
| 106 | # define the stop command |
| 107 | stop_system() |
| 108 | { |
| 109 | # prevent reentry |
| 110 | if [ $INSTOPSYSTEM -eq 1 ]; then return; fi |
| 111 | INSTOPSYSTEM=1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | webserverKillAll |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 113 | # unset exported variables |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 114 | unset TOASTER_DIR |
| 115 | unset BITBAKE_UI |
| 116 | unset BBBASEDIR |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 117 | trap - SIGHUP |
| 118 | #trap - SIGCHLD |
| 119 | INSTOPSYSTEM=0 |
| 120 | } |
| 121 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 122 | verify_prereq() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 123 | # Verify Django version |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | reqfile=$(python3 -c "import os; print(os.path.realpath('$BBBASEDIR/toaster-requirements.txt'))") |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 125 | exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/' |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 126 | # expand version parts to 2 digits to support 1.10.x > 1.8 |
| 127 | # (note:helper functions hard to insert in-line) |
| 128 | exp=$exp'import sys,django;' |
| 129 | exp=$exp'version=["%02d" % int(n) for n in django.get_version().split(".")];' |
| 130 | exp=$exp'vmin=["%02d" % int(n) for n in "\2".split(".")];' |
| 131 | exp=$exp'vmax=["%02d" % int(n) for n in "\4".split(".")];' |
| 132 | exp=$exp'sys.exit(not (version \1 vmin and version \3 vmax))' |
| 133 | exp=$exp'/p' |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 134 | if ! sed -n "$exp" $reqfile | python3 - ; then |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 135 | req=`grep ^Django $reqfile` |
| 136 | echo "This program needs $req" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 137 | echo "Please install with pip3 install -r $reqfile" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 138 | return 2 |
| 139 | fi |
| 140 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 141 | return 0 |
| 142 | } |
| 143 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 144 | # read command line parameters |
| 145 | if [ -n "$BASH_SOURCE" ] ; then |
| 146 | TOASTER=${BASH_SOURCE} |
| 147 | elif [ -n "$ZSH_NAME" ] ; then |
| 148 | TOASTER=${(%):-%x} |
| 149 | else |
| 150 | TOASTER=$0 |
| 151 | fi |
| 152 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 153 | export BBBASEDIR=`dirname $TOASTER`/.. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 154 | MANAGE="python3 $BBBASEDIR/lib/toaster/manage.py" |
Brad Bishop | c4ea075 | 2018-11-15 14:30:15 -0800 | [diff] [blame] | 155 | if [ -z "$OE_ROOT" ]; then |
| 156 | OE_ROOT=`dirname $TOASTER`/../.. |
| 157 | fi |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 158 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 159 | # this is the configuraton file we are using for toaster |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 160 | # we are using the same logic that oe-setup-builddir uses |
| 161 | # (based on TEMPLATECONF and .templateconf) to determine |
| 162 | # which toasterconf.json to use. |
| 163 | # note: There are a number of relative path assumptions |
| 164 | # in the local layers that currently make using an arbitrary |
| 165 | # toasterconf.json difficult. |
| 166 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 167 | . $OE_ROOT/.templateconf |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 168 | if [ -n "$TEMPLATECONF" ]; then |
| 169 | if [ ! -d "$TEMPLATECONF" ]; then |
| 170 | # Allow TEMPLATECONF=meta-xyz/conf as a shortcut |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | if [ -d "$OE_ROOT/$TEMPLATECONF" ]; then |
| 172 | TEMPLATECONF="$OE_ROOT/$TEMPLATECONF" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 173 | fi |
| 174 | fi |
| 175 | fi |
| 176 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 177 | unset OE_ROOT |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 178 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 179 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 180 | WEBSERVER=1 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 181 | export TOASTER_BUILDSERVER=1 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 182 | ADDR_PORT="localhost:8000" |
Brad Bishop | 5dd7cbb | 2018-09-05 22:26:40 -0700 | [diff] [blame] | 183 | TOASTERDIR=`dirname $BUILDDIR` |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 184 | unset CMD |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 185 | for param in $*; do |
| 186 | case $param in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 187 | noweb ) |
| 188 | WEBSERVER=0 |
| 189 | ;; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 190 | nobuild ) |
| 191 | TOASTER_BUILDSERVER=0 |
| 192 | ;; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 193 | start ) |
| 194 | CMD=$param |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 195 | ;; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 196 | stop ) |
| 197 | CMD=$param |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 198 | ;; |
| 199 | webport=*) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 200 | ADDR_PORT="${param#*=}" |
| 201 | # Split the addr:port string |
| 202 | ADDR=`echo $ADDR_PORT | cut -f 1 -d ':'` |
| 203 | PORT=`echo $ADDR_PORT | cut -f 2 -d ':'` |
| 204 | # If only a port has been speified then set address to localhost. |
| 205 | if [ $ADDR = $PORT ] ; then |
| 206 | ADDR_PORT="localhost:$PORT" |
| 207 | fi |
| 208 | ;; |
Brad Bishop | 5dd7cbb | 2018-09-05 22:26:40 -0700 | [diff] [blame] | 209 | toasterdir=*) |
| 210 | TOASTERDIR="${param#*=}" |
| 211 | ;; |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 212 | manage ) |
| 213 | CMD=$param |
| 214 | manage_cmd="" |
| 215 | ;; |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 216 | --help) |
| 217 | echo "$HELP" |
| 218 | return 0 |
| 219 | ;; |
| 220 | *) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 221 | if [ "manage" == "$CMD" ] ; then |
| 222 | manage_cmd="$manage_cmd $param" |
| 223 | else |
| 224 | echo "$HELP" |
| 225 | exit 1 |
| 226 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 227 | ;; |
| 228 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 229 | esac |
| 230 | done |
| 231 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 232 | if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then |
| 233 | echo "Error: This script needs to be sourced. Please run as . $TOASTER" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 234 | return 1 |
| 235 | fi |
| 236 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 237 | verify_prereq || return 1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 238 | |
| 239 | # We make sure we're running in the current shell and in a good environment |
| 240 | if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then |
| 241 | echo "Error: Build environment is not setup or bitbake is not in path." 1>&2 |
| 242 | return 2 |
| 243 | fi |
| 244 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 245 | # this defines the dir toaster will use for |
| 246 | # 1) clones of layers (in _toaster_clones ) |
| 247 | # 2) the build dir (in build) |
| 248 | # 3) the sqlite db if that is being used. |
| 249 | # 4) pid's we need to clean up on exit/shutdown |
Brad Bishop | 5dd7cbb | 2018-09-05 22:26:40 -0700 | [diff] [blame] | 250 | export TOASTER_DIR=$TOASTERDIR |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 251 | export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 252 | |
| 253 | # Determine the action. If specified by arguments, fine, if not, toggle it |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 254 | if [ "$CMD" = "start" ] ; then |
| 255 | if [ -n "$BBSERVER" ]; then |
| 256 | echo " Toaster is already running. Exiting..." |
| 257 | return 1 |
| 258 | fi |
| 259 | elif [ "$CMD" = "" ]; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 260 | echo "No command specified" |
| 261 | echo "$HELP" |
| 262 | return 1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 263 | fi |
| 264 | |
| 265 | echo "The system will $CMD." |
| 266 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 267 | # Execute the commands |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 268 | custom_extention toaster_prepend $CMD $ADDR_PORT |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 269 | |
| 270 | case $CMD in |
| 271 | start ) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 272 | # check if addr:port is not in use |
| 273 | if [ "$CMD" == 'start' ]; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 274 | if [ $WEBSERVER -gt 0 ]; then |
| 275 | $MANAGE checksocket "$ADDR_PORT" || return 1 |
| 276 | fi |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 277 | fi |
| 278 | |
| 279 | # Create configuration file |
| 280 | conf=${BUILDDIR}/conf/local.conf |
| 281 | line='INHERIT+="toaster buildhistory"' |
| 282 | grep -q "$line" $conf || echo $line >> $conf |
| 283 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 284 | if [ $WEBSERVER -eq 0 ] ; then |
| 285 | # Do not update the database for "noweb" unless |
| 286 | # it does not yet exist |
| 287 | if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then |
| 288 | if ! databaseCheck; then |
| 289 | echo "Failed ${CMD}." |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 290 | return 4 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 291 | fi |
| 292 | fi |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 293 | custom_extention noweb_start_postpend $ADDR_PORT |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 294 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 295 | if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then |
| 296 | echo "Failed ${CMD}." |
| 297 | return 4 |
| 298 | fi |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 299 | export BITBAKE_UI='toasterui' |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 300 | if [ $TOASTER_BUILDSERVER -eq 1 ] ; then |
| 301 | $MANAGE runbuilds \ |
| 302 | </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \ |
| 303 | & echo $! >${BUILDDIR}/.runbuilds.pid |
| 304 | else |
| 305 | echo "Toaster build server not started." |
| 306 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 307 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 308 | # set fail safe stop system on terminal exit |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 309 | trap stop_system SIGHUP |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 310 | echo "Successful ${CMD}." |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 311 | custom_extention toaster_postpend $CMD $ADDR_PORT |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 312 | return 0 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 313 | ;; |
| 314 | stop ) |
| 315 | stop_system |
| 316 | echo "Successful ${CMD}." |
| 317 | ;; |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 318 | manage ) |
| 319 | cd $BBBASEDIR/lib/toaster |
| 320 | $MANAGE $manage_cmd |
| 321 | ;; |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 322 | esac |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 323 | custom_extention toaster_postpend $CMD $ADDR_PORT |
| 324 | |