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