Skip to content

Instantly share code, notes, and snippets.

@molcay
Last active November 29, 2019 06:40
Show Gist options
  • Select an option

  • Save molcay/fd93b8077d303fe4f52c1ecf73bc6a23 to your computer and use it in GitHub Desktop.

Select an option

Save molcay/fd93b8077d303fe4f52c1ecf73bc6a23 to your computer and use it in GitHub Desktop.
The basic installation script with dependencies for 'create_ap'

Install create_ap

Basic installation script for create_ap

Usage (Script):

  1. Save the install_create_ap.sh file in your system (for example /home folder).
  • Give the execute permission to the file:
    • chmod +x install_create_ap.sh
  • Run the script:
    • ./install_create_ap.sh
  • *OR After first step you can simply type this to run:
    • bash install_create_ap.sh

Usage(create_ap):

The basic usage is (for Internet sharing): create_ap wlan0 wlan0 AccessPointName PassPhrase

You can also use the run_create_ap.sh script to automate the jobs.

chmod +x run_create_ap.sh
./run_create_ap.sh

For the first usage you can enter the AccessPointName and PassPhare for once. The next run; script can use the previous AccessPointName and PassPhare.

#!/bin/bash
# Install Dependencies
sudo apt-get install -y util-linux
sudo apt-get install -y procps
sudo apt-get install -y hostapd
sudo apt-get install -y iproute2
sudo apt-get install -y iw
sudo apt-get install git-all
git clone https://github.com/oblique/create_ap
cd create_ap
sudo make install
#!/bin/bash
CONF_FILE=~/.create_ap.conf
if [ -f $CONF_FILE ]; then
apname=$(cat $CONF_FILE | head -n1 | awk '{print $1;}')
appassword=$(cat $CONF_FILE | tail -n1 | awk '{print $1;}')
echo "Creation of AP which is named $apname and has password $appassword"
else
echo -n "Please specify the Access Point Name > "
read apname
echo -n "Please specify the Password for $apname > "
read appassword
echo "Creation of AP which is named $apname and has password $appassword"
echo "$apname" > $CONF_FILE
echo "$appassword" >> $CONF_FILE
fi
# finding the Wifi Adaptor
wifiadaptor=$(ifconfig | awk '/^wl/ {print $1}')
echo "sudo create_ap $wifiadaptor $wifiadaptor $apname $appassword"
@molcay
Copy link
Author

molcay commented Nov 29, 2019

Hi @lareya, this guide is a bit old(almost 3 years old) and maybe it has flaws.

Maybe the wifiadaptor variable is not correct for your hardware. You can check out the ifconfig command's output to see Wireless Ethernet Card's device name.

Back in that time, this was starting with the wl for me.

Please check out the original oblique/create_ap repository for further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment