-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hotfix-1.1.3: (25 commits) js/script.js : Add additional disk usage refresh. Switch to version 1.1.3 CHANGELOG: note down RPi Adjustments Version flag 1.1.3-beta RPI-MOTD: Version update Introduced SDCard helper for RPi CHANGELOG: Add missing entries for 1.1.3 lighttpd.conf: Reduce cache to a minimum usb_share.sh: Force disk usage update hostapd.conf: More Comments in hostapd for WPA mode Feature: Add scripts for on the fly client mode wifi_detect: only change piratebox.conf if it is a wifi device wifi_detect.sh: Bugfixes and adjust piratebox configuration hostapd.conf: More comment to enable n wifi mode Fix for issue on RPi3 with multiple wifi cards Fix Shellcheck results Track fix ger language Track new contribution Correct/translate German localisation strings. --added brazilian portuguese translation to the landing page (data.pt-br.properties) ...
- Loading branch information
Showing
24 changed files
with
340 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
interface=wlan0 | ||
driver=nl80211 | ||
ssid=PirateBox - Share Freely | ||
hw_mode=g | ||
|
||
channel=1 | ||
#auth_algs=1 | ||
|
||
# Remove # to enable n wifi mode | ||
#ieee80211n=1 | ||
#wmm_enabled=1 | ||
#ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40] | ||
hw_mode=g | ||
|
||
# Put a # in front of the following line to allow | ||
# direct client 2 client communication | ||
ap_isolate=1 | ||
|
||
# Uncomment the following lines to enable WPA | ||
#wpa=2 | ||
#wpa_key_mgmt=WPA-PSK | ||
#wpa_pairwise=TKIP CCMP | ||
#rsn_pairwise=CCMP | ||
#wpa_passphrase=Somepassphrase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# Wrapper script for the steps to enable wifi client | ||
|
||
systemctl stop piratebox | ||
if /opt/piratebox/rpi/run_client.sh ; then | ||
echo "Started Wifi client sucessfully!" | ||
exit 0 | ||
else | ||
echo "Error while starting wifi client, restarting piratebox" | ||
systemctl start piratebox | ||
exit 1 | ||
fi | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Runs with wpa_supplicant & wifi device from boot folder. | ||
|
||
## Default | ||
WIFI_DEVICE="wlan0" | ||
|
||
WIFI_CONFIG_PATH="/boot/wifi_card.conf" | ||
WPA_SUPPLICANT="/boot/wpa_supplicant.conf" | ||
|
||
# Try to get wifi device | ||
if test -e "${WIFI_CONFIG_PATH}" ; then | ||
echo "Found wifi card config" | ||
WIFI_DEVICE=$( head -n 1 "${WIFI_CONFIG_PATH}" | tr -d '\n' ) | ||
fi | ||
|
||
# Try to connect to Wifi if wpa_supplicant.conf is available. | ||
if [ -f "${WPA_SUPPLICANT}" ]; then | ||
echo "Found wpa_supplicant conf, trying to connect..." | ||
wpa_supplicant -i"${WIFI_DEVICE}" -c "${WPA_SUPPLICANT}" -B -D wext | ||
dhcpcd "${WIFI_DEVICE}" | ||
exit 0 | ||
else | ||
echo "Wifi configuration not found" | ||
exit 1 | ||
fi | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#/bin/bash | ||
|
||
# This script enables the SDCard as ext4 to be used as storage | ||
# it also activates some spare for swap | ||
|
||
MOUNTPOINT="/mnt/sdshare" | ||
FS="ext4" | ||
|
||
|
||
SDCARD="/dev/mmcblk0" | ||
|
||
if test -e "$SDCARD"p3 ; then | ||
echo "ERROR: SWAP already exists" | ||
exit 1 | ||
fi | ||
|
||
if test -e "$SDCARD"p4 ; then | ||
echo "ERROR: Data partition already exists" | ||
exit 1 | ||
fi | ||
|
||
echo "Creating partitions.." | ||
fdisk "$SDCARD" <<EOF | ||
n | ||
p | ||
3 | ||
+256M | ||
n | ||
p | ||
4 | ||
w | ||
EOF | ||
|
||
echo Reloading partition table | ||
partprobe "$SDCARD" | ||
|
||
if test -e "$SDCARD"p3 ; then | ||
if test -e "$SDCARD"p4 ; then | ||
echo "Ok, all partitions available" | ||
else | ||
echo "ERROR: Data partition is missing." | ||
exit 1 | ||
fi | ||
else | ||
echo "ERROR: SWAP missing." | ||
exit 1 | ||
fi | ||
|
||
mkswap /dev/mmcblk0p3 | ||
if [ $? -ne 0 ] ; then | ||
echo "Error formating swap" | ||
exit 1 | ||
fi | ||
|
||
SWAP_UUID=$( blkid | grep "/dev/mmc*.*TYPE=\"swap\"" | egrep -o " UUID=\"([a-zA-Z0-9-])*\"" | sed 's/ //g' ) | ||
|
||
if grep -q "${SWAP_UUID}" /etc/fstab ; then | ||
echo "Error: swap is already configured in fstab" | ||
exit 1 | ||
fi | ||
|
||
echo "Adding swap to fstab" | ||
echo "${SWAP_UUID} none swap defaults 0 0" >> /etc/fstab | ||
|
||
echo "Creating data partition" | ||
mkfs.ext4 -F "$SDCARD"p4 | ||
if [ $? -ne 0 ] ; then | ||
echo "Error formating data" | ||
exit 1 | ||
fi | ||
|
||
DATA_UUID=$( blkid | grep "${SDCARD}p4.*TYPE=\"ext4\"" | egrep -o " UUID=\"([a-zA-Z0-9-])*\"" | sed 's/ //g' ) | ||
if grep -q "${DATA_UUID}" /etc/fstab ; then | ||
echo "Error: data is already configured in fstab" | ||
exit 1 | ||
fi | ||
|
||
echo "${DATA_UUID} ${MOUNTPOINT} ext4 defaults,noatime,nodiratime,data=writeback 0 0 ">> /etc/fstab | ||
|
||
mkdir -p "${MOUNTPOINT}" | ||
mount "${MOUNTPOINT}" | ||
|
||
if [ $? -ne 0 ] ; then | ||
echo "ERROR mounting data partion" | ||
exit 1 | ||
fi | ||
|
||
echo "## Moving files..." | ||
mv /opt/piratebox/share "${MOUNTPOINT}/share" > /dev/null 2>&1 | ||
ln -s "${MOUNTPOINT}/share" /opt/piratebox/share > /dev/null | ||
|
||
|
||
# Force update diskwirte | ||
touch -t 197001010101 /opt/piratebox/www/diskusage.html | ||
wget http://127.0.0.1/cgi-bin/diskwrite.py -q -O - | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
#!/bin/sh | ||
# Try to setup WiFi and if it succeeds, start the PirateBox | ||
/bin/sh -c /opt/piratebox/rpi/bin/wifi_detect.sh && /usr/bin/systemctl start piratebox | ||
|
||
## Default | ||
WIFI_DEVICE="wlan0" | ||
|
||
WIFI_CONFIG_PATH="/boot/wifi_card.conf" | ||
|
||
if test -e "${WIFI_CONFIG_PATH}" ; then | ||
echo "Found wifi card config" | ||
WIFI_DEVICE=$( head -n 1 "${WIFI_CONFIG_PATH}" | tr -d '\n' ) | ||
fi | ||
|
||
|
||
if [ "${INTERFACE}" = "${WIFI_DEVICE}" ] ; then | ||
/bin/sh -c /opt/piratebox/rpi/bin/wifi_detect.sh && /usr/bin/systemctl start piratebox | ||
fi | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# User friendly way to switch to client | ||
# Adds "nohup" option... | ||
|
||
nohup /opt/piratebox/rpi/bin/do_switch_client.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.