mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-07-28 16:22:34 -04:00
Add script to add LAN IP to Nextcloud config
This commit is contained in:
9
casaos-add-lan-ip-to-nextcloud-config/README.md
Normal file
9
casaos-add-lan-ip-to-nextcloud-config/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# About
|
||||
|
||||
This script adds your LAN IP to the nextcloud config.php.
|
||||
|
||||
# Run command
|
||||
|
||||
```bash
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-add-lan-ip-to-nextcloud-config/run.sh)"
|
||||
```
|
||||
16
casaos-add-lan-ip-to-nextcloud-config/run.sh
Normal file
16
casaos-add-lan-ip-to-nextcloud-config/run.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the LAN IP address
|
||||
lan_ip=$(hostname -I | awk '{print $1}')
|
||||
|
||||
# Backup the original config.php file
|
||||
cp /DATA/AppData/big-bear-nextcloud/html/config/config.php /DATA/AppData/big-bear-nextcloud/html/config/config.php.bak
|
||||
|
||||
# Add the LAN IP to the config.php file
|
||||
awk -v ip="$lan_ip" '/0 => '\''localhost'\''/{print; print " 1 => '\''"ip"'\'',"; next}1' /DATA/AppData/big-bear-nextcloud/html/config/config.php.bak > /DATA/AppData/big-bear-nextcloud/html/config/config.php
|
||||
|
||||
# Get the path to the docker-compose.yml file
|
||||
COMPOSE_FILE="/var/lib/casaos/apps/big-bear-nextcloud/docker-compose.yml"
|
||||
|
||||
# Apply changes using casaos-cli
|
||||
casaos-cli app-management apply "big-bear-nextcloud" --file="$COMPOSE_FILE"
|
||||
Reference in New Issue
Block a user