install.sh-c98ac052/install.sh
Darko Lukić dc20ad2303
2018-05-20 14:27:30 +02:00

61 lines
No EOL
1.6 KiB
Bash

#!/bin/bash
# Usage: curl https://pastebin.com/raw/00BXKBA2 | sh
echo "In case of any issues please consult cosmicpi.org for help, or contact us via Facebook "
echo "--- Expand the file system ---"
sudo resize2fs /dev/mmcblk0p2
echo "--- Update OS ---"
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install python-pip
echo "--- Install CosmicPi software --"
sudo pip install cosmicpi
# Configure AP mode
# Populate `/etc/dnsmasq.conf` file
echo "--- Configure AP mode ---"
sudo bash -c 'cat > /etc/dnsmasq.conf' << EOF
interface=wlan0
dhcp-range=192.168.12.50,192.168.12.150,255.255.255.0,24h
address=/apple.com/192.168.12.1
address=/appleiphonecell.com/192.168.12.1
address=/airport.us/192.168.12.1
address=/akamaiedge.net/192.168.12.1
address=/akamaitechnologies.com/192.168.12.1
address=/microsoft.com/192.168.12.1
address=/msftncsi.com/192.168.12.1
address=/msftconnecttest.com/192.168.12.1
address=/google.com/192.168.12.1
address=/gstatic.com/192.168.12.1
address=/googleapis.com/192.168.12.1
address=/android.com/192.168.12.1
EOF
sudo systemctl restart dnsmasq
# Populate `/etc/dhcpcd.conf` file
sudo bash -c 'cat > /etc/dhcpcd.conf' << EOF
hostname
clientid
presistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
option ntp_servers
require dhcp_server_identifier
slaac private
profile static_wlan0
static ip_address=192.168.12.1
static routers=192.168.12.1
static domain_name_servers=192.168.12.1
interface wlan0
fallback static_wlan0
EOF
sudo systemctl restart dhcpcd