Persist AP override across reboots
/tmp/babycam-ap-override → /var/lib/babycam/ap-override setup.sh legt /var/lib/babycam mit chown pi:pi an Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7cfc958cf0
commit
30180e5923
|
|
@ -163,7 +163,7 @@ def wifi_scan():
|
|||
|
||||
@app.route("/ap/<action>", methods=["POST"])
|
||||
def ap_control(action):
|
||||
override_file = "/tmp/babycam-ap-override"
|
||||
override_file = "/var/lib/babycam/ap-override"
|
||||
if action == "on":
|
||||
with open(override_file, "w") as f:
|
||||
f.write("on")
|
||||
|
|
@ -183,7 +183,7 @@ def ap_control(action):
|
|||
|
||||
def get_ap_override():
|
||||
try:
|
||||
with open("/tmp/babycam-ap-override") as f:
|
||||
with open("/var/lib/babycam/ap-override") as f:
|
||||
return f.read().strip().lower()
|
||||
except FileNotFoundError:
|
||||
return "auto"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ AP_INTERFACE = "wlan1"
|
|||
CLIENT_INTERFACE = "wlan0"
|
||||
AP_IP = "192.168.50.1"
|
||||
CHECK_INTERVAL = 30 # Sekunden
|
||||
OVERRIDE_FILE = "/tmp/babycam-ap-override"
|
||||
OVERRIDE_FILE = "/var/lib/babycam/ap-override"
|
||||
|
||||
|
||||
def run(cmd, check=False):
|
||||
|
|
|
|||
4
setup.sh
4
setup.sh
|
|
@ -46,6 +46,10 @@ fi
|
|||
# ------------------------------------------------------------------------------
|
||||
# 3. Projektdateien installieren
|
||||
# ------------------------------------------------------------------------------
|
||||
info "Verzeichnisse anlegen..."
|
||||
mkdir -p /var/lib/babycam
|
||||
chown pi:pi /var/lib/babycam
|
||||
|
||||
info "Projektdateien nach $INSTALL_DIR kopieren..."
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
cp -r "$REPO_DIR/app" "$INSTALL_DIR/"
|
||||
|
|
|
|||
Loading…
Reference in New Issue