mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-04-20 07:16:06 -04:00
Added fortune file via ENV VAR and in data dir.
Added missing config and data dir in previous commit
This commit is contained in:
parent
eedb7c448d
commit
b3bae047d5
@ -96,6 +96,8 @@ Be sure you've followed the Python virtual environment steps above and activated
|
||||
The docker entrypoint.sh will automatically copy config.ini.sample to config.ini
|
||||
if you want to edit config, make sure you add the config directory as a docker volume.
|
||||
|
||||
Environment Variables: FORTUNE_FILE, DB_FILE, CONFIG_FILE
|
||||
|
||||
```sh
|
||||
docker run -it --name tc2bbsmesh -v tc2bbsmesh-config:/app/config/ -v tc2bbsmesh-data:/app/data/ --device=/dev/ttyACM0 tc2-bbs-mesh
|
||||
```
|
||||
|
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
import time
|
||||
|
||||
@ -89,7 +90,7 @@ def handle_stats_command(sender_id, interface):
|
||||
|
||||
def handle_fortune_command(sender_id, interface):
|
||||
try:
|
||||
with open('fortunes.txt', 'r') as file:
|
||||
with open(os.getenv('FORTUNE_FILE','data/fortunes.txt'), 'r') as file:
|
||||
fortunes = file.readlines()
|
||||
if not fortunes:
|
||||
send_message("No fortunes available.", sender_id, interface)
|
||||
@ -389,4 +390,4 @@ def handle_channel_directory_steps(sender_id, message, step, state, interface):
|
||||
channel_name = state['channel_name']
|
||||
add_channel(channel_name, channel_url)
|
||||
send_message(f"Your channel '{channel_name}' has been added to the directory.", sender_id, interface)
|
||||
handle_channel_directory_command(sender_id, interface)
|
||||
handle_channel_directory_command(sender_id, interface)
|
||||
|
Loading…
x
Reference in New Issue
Block a user