Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hotspot offline setup #1967

Merged
merged 5 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
- 'build.bash'
- 'build-image/openhabian-installer.service'
- 'build-image/first-boot.bash'
- 'build-image/openhabian.conf'
- 'build-image/offline-image-modifications.bash'
- '.github/workflows/build-action.yml'
pull_request:
paths:
- 'build.bash'
- 'build-image/openhabian-installer.service'
- 'build-image/first-boot.bash'
- 'build-image/openhabian.conf'
- 'build-image/offline-image-modifications.bash'
- '.github/workflows/build-action.yml'
workflow_dispatch:
Expand Down
16 changes: 9 additions & 7 deletions build-image/offline-install-modifications.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
export BASEDIR="/opt/openhabian"
export DEBIAN_FRONTEND="noninteractive"
export PREOFFLINE="1"
comitupurl=https://davesteele.github.io/comitup/deb/
comitupfile=davesteele-comitup-apt-source_1.2_all.deb
comituprepofile=/etc/apt/sources.d/comitup.list
debfileurl=https://davesteele.github.io/comitup/deb
debfile=davesteele-comitup-apt-source
debfilelatest=latest.deb
debfilestatic=1.2_all.deb
comituprepofile=/etc/apt/sources.d/davesteele-comitup.list

source /opt/openhabian/functions/helpers.bash
add_keys "https://openhab.jfrog.io/artifactory/api/gpg/key/public" "openhab"
echo "deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main" > /etc/apt/sources.list.d/openhab.list

# comitup hotspot
wget -nv "${comitupurl}/$comitupfile"
dpkg -i --force-all "$comitupfile"
rm -f "$comitupfile"
wget -nv "${debfileurl}/${debfile}_${debfilelatest}" -O ${debfile}_${debfilelatest} || wget -nv "${debfileurl}/${debfile}_${debfilestatic} -O ${debfile}_${debfilelatest}"
dpkg -i --force-all "${debfile}_${debfilelatest}"
rm -f "${debfile}*.deb"
if [[ ! -f ${comituprepofile} ]]; then
echo "deb http://davesteele.github.io/comitup/repo comitup main" > $comituprepofile
echo "deb [signed-by=/usr/share/keyrings/davesteele-archive-keyring.gpg] http://davesteele.github.io/comitup/repo comitup main" > $comituprepofile
fi

# tailscale VPN
Expand Down
14 changes: 7 additions & 7 deletions functions/wifi.bash
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ configure_wifi() {
## setup_hotspot(String option)
##
setup_hotspot() {
local debfileurl="https://davesteele.github.io/comitup/latest"
local debfile="davesteele-comitup-apt-source"
local debfilelatest="latest.deb"
local debfilestatic="1.2_all.deb"
local debfileurl=https://davesteele.github.io/comitup/deb
local debfile=davesteele-comitup-apt-source
local debfilelatest=latest.deb
local debfilestatic=1.2_all.deb


if [[ $1 == "install" ]]; then
Expand All @@ -130,11 +130,11 @@ setup_hotspot() {
DEBIAN_FRONTEND=noninteractive apt install --yes network-manager &> /dev/null
systemctl enable --now NetworkManager

if cond_redirect wget -nv "${debfileurl}/${debfile}_${debfilelatest}" || wget -nv "${debfileurl}/${debfile}_${debfilestatic}"; then
cond_redirect dpkg -i --force-all "${debfile}*.deb"
if cond_redirect wget -nv "${debfileurl}/${debfile}_${debfilelatest}" -O ${debfile}_${debfilelatest} || wget -nv "${debfileurl}/${debfile}_${debfilestatic} -O ${debfile}_${debfilelatest}"; then
cond_redirect dpkg -i --force-all "${debfile}_${debfilelatest}"
cond_redirect apt-get --quiet update
fi
rm -f "$debfile"
rm -f "${debfile}*.deb"

if ! cp "${BASEDIR:-/opt/openhabian}"/includes/comitup.conf /etc/comitup.conf; then echo "FAILED (comitup config)"; return 1; fi
# shellcheck disable=SC2154
Expand Down