Skip to content

Commit

Permalink
Make logging conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
rmens committed Apr 1, 2024
1 parent 0f7e73f commit e3a9c88
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,24 @@ fi
FF_OUTPUT_SERVER="srt://$STREAM_HOST:$STREAM_PORT?pkt_size=1316&mode=caller&transtype=live&streamid=$STREAM_MOUNTPOINT&passphrase=$STREAM_PASSWORD"

# Add RAM disk
echo -e "${BLUE}►► Setting up RAM disk for logs...${NC}"
rm -f "$RAMDISK_SERVICE_PATH" > /dev/null
curl -s -o "$RAMDISK_SERVICE_PATH" "$RAMDISK_SERVICE_URL"
systemctl daemon-reload > /dev/null
systemctl enable ramdisk > /dev/null
systemctl start ramdisk
if [ "$SAVE_OUTPUT" == "y" ]; then
echo -e "${BLUE}►► Setting up RAM disk for logs...${NC}"
rm -f "$RAMDISK_SERVICE_PATH" > /dev/null
curl -s -o "$RAMDISK_SERVICE_PATH" "$RAMDISK_SERVICE_URL"
systemctl daemon-reload > /dev/null
systemctl enable ramdisk > /dev/null
systemctl start ramdisk
fi

# Put FFmpeg logs on RAM disk
echo -e "${BLUE}►► Putting FFmpeg logs on the RAM disk...${NC}"
if [ -d "$STREAM_LOG_DIR" ]; then
echo -e "${YELLOW}Log directory exists. Removing it before creating the symlink.${NC}"
rm -rf "$STREAM_LOG_DIR"
if [ "$SAVE_OUTPUT" == "y" ]; then
echo -e "${BLUE}►► Putting FFmpeg logs on the RAM disk...${NC}"
if [ -d "$STREAM_LOG_DIR" ]; then
echo -e "${YELLOW}Log directory exists. Removing it before creating the symlink.${NC}"
rm -rf "$STREAM_LOG_DIR"
ln -s "$RAMDISK_PATH" "$STREAM_LOG_DIR"
fi
fi
ln -s "$RAMDISK_PATH" "$STREAM_LOG_DIR"

# Create the configuration file for supervisor
cat << EOF > $STREAM_CONFIG_PATH
Expand Down

0 comments on commit e3a9c88

Please sign in to comment.