Skip to content

Commit

Permalink
TorBox mini: Added --continue_with_step / preventing executing hostap…
Browse files Browse the repository at this point in the history
…d commands if it is masked
  • Loading branch information
radio24 committed Apr 1, 2024
1 parent 845fb80 commit f32a183
Show file tree
Hide file tree
Showing 10 changed files with 718 additions and 643 deletions.
8 changes: 6 additions & 2 deletions bin/change_MAC
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,12 @@ change_mac_address_finish()
# I guess the old one was wrong
# if [[ "$O_DEVICE" =~ "$CLIENT_IFACE" ]]; then
if [[ "$CLIENT_IFACE" =~ "$O_DEVICE" ]]; then
echo -e "${RED}[+] Restarting hostapd!${NOCOLOR}"
sudo systemctl restart hostapd
# New v.0.5.4 avoid to run hostapd if it is masked
AP_STATUS=$(sudo systemctl is-enable hostapd)
if [ "$AP_STATUS" != "masked" ] ; then
echo -e "${RED}[+] Restarting hostapd!${NOCOLOR}"
sudo systemctl restart hostapd
fi
elif [[ "$INTERNET_IFACE" == "$O_DEVICE" ]]; then
echo
echo -e "${YELLOW}[!] YOU MUST RECONNECT TO THE INTERNET IN THE MAIN MENU!${NOCOLOR}"
Expand Down
26 changes: 17 additions & 9 deletions bin/hostapd_fallback_komplex_part_1
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,26 @@ fi
# If wlan0 or wlan1 is not acting as AP then we have to do something about it!
if ! grep "^interface=$INTERFACE1" ${HOSTAPD} ; then
sudo sed -i "s/^interface=.*/interface=$INTERFACE1/" ${HOSTAPD}
sudo systemctl restart hostapd
sleep 5
AP_STATUS=$(sudo systemctl is-active hostapd)
if [ $AP_STATUS = activating ] || [ $AP_STATUS = inactive ] ; then
sudo sed -i "s/^hw_mode=a/hw_mode=g/" ${HOSTAPD}
sudo sed -i "s/^channel=.*/channel=6/" ${HOSTAPD}
sudo sed -i "s/^ht_capab=[HT40-][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]/#ht_capab=[HT40-][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]/" ${HOSTAPD}
sudo sed -i "s/^vht_oper_chwidth=1/#vht_oper_chwidth=1/" ${HOSTAPD}
sudo sed -i "s/^vht_oper_centr_freq_seg0_idx=42/#vht_oper_centr_freq_seg0_idx=42/" ${HOSTAPD}
# New v.0.5.4 avoid to run hostapd if it is masked
AP_STATUS=$(sudo systemctl is-enable hostapd)
if [ "$AP_STATUS" != "masked" ] ; then
sudo systemctl restart hostapd
sleep 5
fi
# New v.0.5.4 avoid to run hostapd if it is masked
AP_STATUS=$(sudo systemctl is-enable hostapd)
if [ "$AP_STATUS" != "masked" ] ; then
AP_STATUS=$(sudo systemctl is-active hostapd)
if [ $AP_STATUS = activating ] || [ $AP_STATUS = inactive ] ; then
sudo sed -i "s/^hw_mode=a/hw_mode=g/" ${HOSTAPD}
sudo sed -i "s/^channel=.*/channel=6/" ${HOSTAPD}
sudo sed -i "s/^ht_capab=[HT40-][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]/#ht_capab=[HT40-][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]/" ${HOSTAPD}
sudo sed -i "s/^vht_oper_chwidth=1/#vht_oper_chwidth=1/" ${HOSTAPD}
sudo sed -i "s/^vht_oper_centr_freq_seg0_idx=42/#vht_oper_centr_freq_seg0_idx=42/" ${HOSTAPD}
sudo systemctl restart hostapd
sleep 5
fi
fi
fi

# Is INTERFACE2 ready?
Expand Down
2 changes: 2 additions & 0 deletions etc/rc.local.mini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ rfkill unblock all
rfkill block bluetooth
bash /home/torbox/torbox/bin/regset
sudo systemctl stop hostapd
sudo systemctl disable hostapd
sudo systemctl mask hostapd

if grep "TWEBSSH=1" /home/torbox/torbox/run/torbox.run ; then
[ ! -f /etc/nginx/sites-available/webssh.conf ] && sudo cp /home/torbox/torbox/etc/nginx/sites-available/sample-webssh.conf /etc/nginx/sites-available/webssh.conf
Expand Down
2 changes: 1 addition & 1 deletion install/run_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ re-connect()
echo -e "${RED}[+] Yes, we have Internet! :-)${NOCOLOR}"
else
echo -e "${YELLOW}[!] Hmmm, no we don't have Internet... :-(${NOCOLOR}"
echo -e "${RED}[+] We will check again in about 30 seconds...${NOCOLOR}"
echo -e "${RED}[+] We will check again in about 30 seconds...${NOCOLOR}"
sleep 30
echo ""
echo -e "${RED}[+] Trying again...${NOCOLOR}"
Expand Down
Loading

0 comments on commit f32a183

Please sign in to comment.