Files
pseudo-channel/main-dir/stop-all-boxes.sh
mutto233 8a97233523 Added stop-all-boxes
Shell script "stop-all-boxes.sh" has been added, so if there are multiple sets of boxes and you want to turn them all off you can.
2018-07-11 11:08:44 -04:00

26 lines
624 B
Bash

#!/bin/bash
# Function will call stop-all-channels.sh on ALL current boxes.
# The purpose of this falls mainly to a kind of soft "reset", as well as for channel updating.
CHANNEL_DIR_INCREMENT_SYMBOL="_"
MASTERDIRECTORY="channels"
cd ..
BOX_DIR_ARR=( $(find . -maxdepth 1 -type d -name 'channels'"$CHANNEL_DIR_INCREMENT_SYMBOL"'*' -printf "%P\n" | sort -t"$CHANNEL_DIR_INCREMENT_SYMBOL" -n) )
BOX_DIR_ARR+=("${MASTERDIRECTORY}")
echo "+++++ FOUND THE FOLLOWING BOXES: ${BOX_DIR_ARR[@]}"
for BOX in "${BOX_DIR_ARR[@]}"
do
cd ${BOX}
echo "+++++ CURRENTLY STOPPING ${BOX}"
sudo ./stop-all-channels.sh
cd ..
done