Skip to content
Closed
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
16 changes: 14 additions & 2 deletions configs/.zshrc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,23 @@ function update-astroarch()
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 15000 'Update AstroArch' "⚠️ Dependency risks detected. Details saved to $RISK_LOG"

# Confirmation request via kdialog
kdialog --title "AstroArch Update - Risk of Addiction" \
local PROCEED_UPDATE=1
# Test : GUI ?
if [[ -n "$DISPLAY" && -z "$SSH_CLIENT" && -z "$SSH_TTY" ]]; then
kdialog --title "AstroArch Update - Risk of Addiction" \
--warningyesno "Warning! The following critical packages will have their dependencies changed:\n\n- $list_str\n\nDo you want to proceed the update anyway?"
[[ $? -ne 0 ]] && PROCEED_UPDATE=0
else
# Terminal mode no GUI
echo -e "\n⚠️ WARNING: Critical dependencies will change!"
echo -e "$list_str"
echo -n "Do you want to proceed the update anyway? (y/N): "
read -r response
[[ ! "$response" =~ ^[yY][eE]?[sS]?$ ]] && PROCEED_UPDATE=0
fi

# If the user clicks “No”
if [ $? -ne 0 ]; then
if [ $PROCEED_UPDATE -eq 0 ]; then
echo "❌ Update canceled by user."
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'Update AstroArch' "❌ Update canceled by user"
return 0
Expand Down
6 changes: 6 additions & 0 deletions scripts/create_ap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
CONN_NAME=astroarch-hotspot
SSID=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 8)

# Short pause to ensure that the Wi-Fi driver is fully awake
sleep 2

nmcli connection add type wifi ifname wlan0 con-name $CONN_NAME autoconnect yes ssid AstroArch-$SSID
nmcli connection modify $CONN_NAME connection.autoconnect-priority -100;
nmcli connection modify $CONN_NAME 802-11-wireless.mode ap ipv4.method shared
nmcli connection modify $CONN_NAME wifi-sec.key-mgmt wpa-psk;
nmcli connection modify $CONN_NAME wifi-sec.psk "astronomy"
nmcli connection modify $CONN_NAME ipv6.method "disabled"

# Force the launch of the hotspot
nmcli connection up $CONN_NAME
7 changes: 4 additions & 3 deletions systemd/create_ap.service
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[Unit]
Description=Create an AP with a semi random name
After=NetworkManager-wait-online.service
Wants=NetworkManager-wait-online.service
After=NetworkManager.service
Wants=NetworkManager.service

[Service]
ExecStart=/bin/bash /home/astronaut/.astroarch/scripts/create_ap.sh
ExecStop=/bin/systemctl disable create_ap.service
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target