Initial Commit
This commit is contained in:
7
apsetup/etc/piwifiap.conf
Normal file
7
apsetup/etc/piwifiap.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
# piwifiap.conf
|
||||
# Configuration file for PiWifiAP
|
||||
|
||||
network_system="unknown"
|
||||
|
||||
wapssid="none"
|
||||
wappass="none"
|
||||
3
apsetup/etc/webmin/custom/1630026603.cmd
Normal file
3
apsetup/etc/webmin/custom/1630026603.cmd
Normal file
@@ -0,0 +1,3 @@
|
||||
sudo wap-enable
|
||||
Enable Wireless Access Point
|
||||
* 0 1 0 0 0 0 0 -
|
||||
1
apsetup/etc/webmin/custom/1630026603.html
Normal file
1
apsetup/etc/webmin/custom/1630026603.html
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
3
apsetup/etc/webmin/custom/1630026756.cmd
Normal file
3
apsetup/etc/webmin/custom/1630026756.cmd
Normal file
@@ -0,0 +1,3 @@
|
||||
sudo wap-disable
|
||||
Disable Wireless Access Point
|
||||
* 0 1 0 0 0 0 0 -
|
||||
1
apsetup/etc/webmin/custom/1630026756.html
Normal file
1
apsetup/etc/webmin/custom/1630026756.html
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
11
apsetup/etc/webmin/custom/1630027149.edit
Normal file
11
apsetup/etc/webmin/custom/1630027149.edit
Normal file
@@ -0,0 +1,11 @@
|
||||
/etc/hostapd/hostapd.conf
|
||||
Edit Wireless Access Point Parameters
|
||||
|
||||
|
||||
|
||||
|
||||
systemctl restart hostapd
|
||||
0
|
||||
0
|
||||
|
||||
|
||||
1
apsetup/etc/webmin/custom/1630027149.html
Normal file
1
apsetup/etc/webmin/custom/1630027149.html
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
8
apsetup/etc/webmin/custom/config
Normal file
8
apsetup/etc/webmin/custom/config
Normal file
@@ -0,0 +1,8 @@
|
||||
display_mode=1
|
||||
params_file=0
|
||||
params_cmd=0
|
||||
columns=1
|
||||
height=
|
||||
wrap=
|
||||
width=
|
||||
sort=
|
||||
27
apsetup/usr/local/bin/wap-disable
Normal file
27
apsetup/usr/local/bin/wap-disable
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Disable PiWifiAP wireless access point
|
||||
|
||||
current_user=`whoami`
|
||||
if [ "$current_user" != "root" ]
|
||||
then
|
||||
echo "You must have root privileges to run this setup."
|
||||
echo "Try 'sudo $0'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/piwifiap.conf
|
||||
|
||||
if [ "$network_system" = "systemd-networkd" ]
|
||||
then
|
||||
systemctl stop hostapd
|
||||
systemctl disable hostapd
|
||||
elif [ "$network_system" = "NetworkManager" ]
|
||||
then
|
||||
nmcli con down piwifi-ap
|
||||
nmcli con mod piwifi-ap autoconnect no
|
||||
else
|
||||
echo "Unable to determine what type of network configuration (systemd-networkd"
|
||||
echo "or NetworkManager) your system uses."
|
||||
echo "Cannot disable wireless access point."
|
||||
exit 2
|
||||
fi
|
||||
28
apsetup/usr/local/bin/wap-enable
Normal file
28
apsetup/usr/local/bin/wap-enable
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Enable PiWifiAP wireless access point
|
||||
|
||||
current_user=`whoami`
|
||||
if [ "$current_user" != "root" ]
|
||||
then
|
||||
echo "You must have root privileges to run this setup."
|
||||
echo "Try 'sudo $0'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/piwifiap.conf
|
||||
|
||||
if [ "$network_system" = "systemd-networkd" ]
|
||||
then
|
||||
systemctl enable hostapd
|
||||
systemctl start hostapd
|
||||
elif [ "$network_system" = "NetworkManager" ]
|
||||
then
|
||||
nmcli con mod piwifi-ap autoconnect yes
|
||||
nmcli con up piwifi-ap
|
||||
else
|
||||
echo "Unable to determine what type of network configuration (systemd-networkd"
|
||||
echo "or NetworkManager) your system uses."
|
||||
echo "Cannot enable wireless access point."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
47
apsetup/usr/local/bin/wap-setpassphrase
Normal file
47
apsetup/usr/local/bin/wap-setpassphrase
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Set passphrase for PiWifiAP wireless access point
|
||||
|
||||
current_user=`whoami`
|
||||
if [ "$current_user" != "root" ]
|
||||
then
|
||||
echo "You must have root privileges to run this setup."
|
||||
echo "Try 'sudo $0'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/piwifiap.conf
|
||||
|
||||
newppok=0
|
||||
while [ "$newppok" -ne 1 ]
|
||||
do
|
||||
echo -n "New passphrase: "
|
||||
read newpp
|
||||
newpplen=`echo -n $newpp | wc -m`
|
||||
if [ "$newpp" = "" -o "$newpplen" -lt 8 ]
|
||||
then
|
||||
echo "Passphrase didn't satisfy requirements. Try again or hit <ctrl>-c to abort."
|
||||
else
|
||||
newppok=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$network_system" = "systemd-networkd" ]
|
||||
then
|
||||
sed -i "/wpa_passphrase=.*/c wpa_passphrase=$newpp" /etc/hostapd/hostapd.conf
|
||||
systemctl restart hostapd
|
||||
elif [ "$network_system" = "NetworkManager" ]
|
||||
then
|
||||
nmcli con down piwifi-ap
|
||||
nmcli con mod piwifi-ap wifi-sec.psk "$newpp"
|
||||
nmcli con up piwifi-ap
|
||||
else
|
||||
echo "Unable to determine what type of network configuration (systemd-networkd"
|
||||
echo "or NetworkManager) your system uses."
|
||||
echo "Cannot modify wireless access point parameters."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
sed -i 's,'wappass=.*','wappass="\"$newpp\""',' /etc/piwifiap.conf
|
||||
|
||||
|
||||
|
||||
45
apsetup/usr/local/bin/wap-setssid
Normal file
45
apsetup/usr/local/bin/wap-setssid
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# Set SSID for PiWifiAP wireless access point
|
||||
|
||||
current_user=`whoami`
|
||||
if [ "$current_user" != "root" ]
|
||||
then
|
||||
echo "You must have root privileges to run this setup."
|
||||
echo "Try 'sudo $0'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/piwifiap.conf
|
||||
|
||||
newssidok=0
|
||||
while [ "$newssidok" -ne 1 ]
|
||||
do
|
||||
echo -n "New SSID: "
|
||||
read newssid
|
||||
if [ "$newssid" = "" ]
|
||||
then
|
||||
echo "SSID cannot be blank. Try again or hit <ctrl>-c to abort."
|
||||
else
|
||||
newssidok=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$network_system" = "systemd-networkd" ]
|
||||
then
|
||||
sed -i "/ssid=.*/c ssid=$newssid" /etc/hostapd/hostapd.conf
|
||||
systemctl restart hostapd
|
||||
elif [ "$network_system" = "NetworkManager" ]
|
||||
then
|
||||
nmcli con down piwifi-ap
|
||||
nmcli con mod piwifi-ap ssid "$newssid"
|
||||
nmcli con up piwifi-ap
|
||||
else
|
||||
echo "Unable to determine what type of network configuration (systemd-networkd"
|
||||
echo "or NetworkManager) your system uses."
|
||||
echo "Cannot modify wireless access point parameters."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
sed -i 's,'wapssid=.*','wapssid="\"$newssid\""',' /etc/piwifiap.conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user