Skip to content
Open
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
7 changes: 7 additions & 0 deletions install_prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ archInstall() {
sudo python -m pip install --user --upgrade git+https://github.com/drbild/sslpsk.git
}

fedoraInstall() {
sudo dnf -y install git iw dnsmasq hostapd screen curl python3-pip python3-wheel python3-pycryptodomex python3-paho-mqtt python3-tornado mosquitto haveged iproute iputils openssl
sudo python3 -m pip install --user --upgrade git+https://github.com/doronz88/sslpsk.git@refactor/ssl-context
}

if [[ -e /etc/os-release ]]; then
source /etc/os-release
else
Expand All @@ -23,6 +28,8 @@ if [[ ${ID} == 'debian' ]] || [[ ${ID_LIKE-} == 'debian' ]]; then
debianInstall
elif [[ ${ID} == 'arch' ]] || [[ ${ID_LIKE-} == 'arch' ]]; then
archInstall
elif [[ ${ID} == 'fedora' ]] || [[ ${ID_LIKE-} == 'fedora' ]]; then
fedoraInstall
else
if [[ -n ${ID_LIKE-} ]]; then
printID="${ID}/${ID_LIKE}"
Expand Down
17 changes: 17 additions & 0 deletions start_flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
bold=$(tput bold)
normal=$(tput sgr0)
. ./config.txt
# whether we found systemd-resolved during setup
resolved=""

setup () {
echo "tuya-convert $(git describe --tags)"
if sudo systemctl is-active systemd-resolved.service > /dev/null 2>&1; then
resolved="yes"
echo "systemd-resolved is running! we must disable it."
echo "name resolution will not work until this script is done."
echo "if this script does not exit cleanly, you may need to run:"
echo "sudo systemctl unmask systemd-resolved.service"
echo "sudo systemctl start systemd-resolved.service"
sudo systemctl stop systemd-resolved.service
sudo systemctl mask systemd-resolved.service
fi
pushd scripts >/dev/null || exit
. ./setup_checks.sh
screen_minor=$(screen --version | cut -d . -f 2)
Expand Down Expand Up @@ -41,6 +53,11 @@ cleanup () {
sudo screen -S smarthack-udp -X stuff '^C'
echo "Closing AP"
sudo pkill hostapd
if [ -n ${resolved} ]; then
echo "Re-enabling systemd-resolved..."
sudo systemctl unmask systemd-resolved.service || echo "Unmasking systemd-resolved.service failed! Please clean up manually"
sudo systemctl start systemd-resolved.service || echo "Restarting systemd-resolved.service failed! Please clean up manually"
fi
echo "Exiting..."
popd >/dev/null || exit
}
Expand Down