mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
Update bootstrap.sh
This commit is contained in:
26
bootstrap.sh
26
bootstrap.sh
@@ -3,13 +3,25 @@ set -e
|
|||||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
cd "$BASE_DIR"
|
cd "$BASE_DIR"
|
||||||
python3 -m venv "$BASE_DIR/venv"
|
|
||||||
|
if [[ ! -d "$BASE_DIR/venv" ]]; then
|
||||||
|
python3 -m venv "$BASE_DIR/venv"
|
||||||
|
fi
|
||||||
|
|
||||||
source "$BASE_DIR/venv/bin/activate"
|
source "$BASE_DIR/venv/bin/activate"
|
||||||
"$BASE_DIR/venv/bin/pip" install -r "$BASE_DIR/requirements.txt"
|
"$BASE_DIR/venv/bin/pip" install -r "$BASE_DIR/requirements.txt"
|
||||||
cp -r "$BASE_DIR/etc/data/." "$BASE_DIR/data/"
|
|
||||||
cp "$BASE_DIR/etc/config.template" "$BASE_DIR/config.ini"
|
mkdir -p "$BASE_DIR/data"
|
||||||
replace="s|type = serial|type = tcp|g"
|
cp -Rn "$BASE_DIR/etc/data/." "$BASE_DIR/data/"
|
||||||
sed -i '' "$replace" "$BASE_DIR/config.ini"
|
|
||||||
replace="s|# hostname = meshtastic.local|hostname = localhost|g"
|
if [[ ! -f "$BASE_DIR/config.ini" ]]; then
|
||||||
sed -i '' "$replace" "$BASE_DIR/config.ini"
|
cp "$BASE_DIR/etc/config.template" "$BASE_DIR/config.ini"
|
||||||
|
replace="s|type = serial|type = tcp|g"
|
||||||
|
sed -i '' "$replace" "$BASE_DIR/config.ini"
|
||||||
|
replace="s|# hostname = meshtastic.local|hostname = localhost|g"
|
||||||
|
sed -i '' "$replace" "$BASE_DIR/config.ini"
|
||||||
|
else
|
||||||
|
echo "config.ini already exists, leaving it unchanged."
|
||||||
|
fi
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
|
|||||||
Reference in New Issue
Block a user