#!/bin/bash # # This version uses September 2017 august stretch image, please use this image # if [ "$EUID" -ne 0 ] then echo "Must be root" exit fi if [[ $# -lt 1 ]]; then echo "You need to pass a password!" echo "Usage:" echo "sudo $0 yourChosenPassword [apName]" exit fi APPASS="$1" APSSID="rPi3" if [[ $# -eq 2 ]]; then APSSID=$2 fi apt-get remove --purge hostapd -yqq apt-get update -yqq apt-get upgrade -yqq apt-get install hostapd dnsmasq -yqq cat > /etc/dnsmasq.conf < /etc/hostapd/hostapd.conf <> /etc/network/interfaces <> /etc/dhcpcd.conf systemctl enable hostapd systemctl enable dnsmasq sudo service hostapd start sudo service dnsmasq start echo "All done! Please reboot"