mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2026-02-04 07:40:48 +00:00
second Pivivlion config and scripts
This commit is contained in:
parent
ec3b32f724
commit
be27c43cf9
14 changed files with 0 additions and 0 deletions
42
home/pi/pivilion/config/dhcpcd.deny.wlan0
Normal file
42
home/pi/pivilion/config/dhcpcd.deny.wlan0
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# A sample configuration for dhcpcd.
|
||||
# See dhcpcd.conf(5) for details.
|
||||
|
||||
# Allow users of this group to interact with dhcpcd via the control socket.
|
||||
#controlgroup wheel
|
||||
|
||||
# Inform the DHCP server of our hostname for DDNS.
|
||||
hostname
|
||||
|
||||
# Use the hardware address of the interface for the Client ID.
|
||||
clientid
|
||||
# or
|
||||
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
|
||||
#duid
|
||||
|
||||
# Persist interface configuration when dhcpcd exits.
|
||||
persistent
|
||||
|
||||
# Rapid commit support.
|
||||
# Safe to enable by default because it requires the equivalent option set
|
||||
# on the server to actually work.
|
||||
option rapid_commit
|
||||
|
||||
# A list of options to request from the DHCP server.
|
||||
option domain_name_servers, domain_name, domain_search, host_name
|
||||
option classless_static_routes
|
||||
# Most distributions have NTP support.
|
||||
option ntp_servers
|
||||
# Respect the network MTU.
|
||||
# Some interface drivers reset when changing the MTU so disabled by default.
|
||||
#option interface_mtu
|
||||
|
||||
# A ServerID is required by RFC2131.
|
||||
require dhcp_server_identifier
|
||||
|
||||
# Generate Stable Private IPv6 Addresses instead of hardware based ones
|
||||
slaac private
|
||||
|
||||
# A hook script is provided to lookup the hostname if not set by the DHCP
|
||||
# server, but it should not be run by default.
|
||||
nohook lookup-hostname
|
||||
denyinterfaces wlan0
|
||||
41
home/pi/pivilion/config/dhcpcd.orig
Normal file
41
home/pi/pivilion/config/dhcpcd.orig
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# A sample configuration for dhcpcd.
|
||||
# See dhcpcd.conf(5) for details.
|
||||
|
||||
# Allow users of this group to interact with dhcpcd via the control socket.
|
||||
#controlgroup wheel
|
||||
|
||||
# Inform the DHCP server of our hostname for DDNS.
|
||||
hostname
|
||||
|
||||
# Use the hardware address of the interface for the Client ID.
|
||||
clientid
|
||||
# or
|
||||
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
|
||||
#duid
|
||||
|
||||
# Persist interface configuration when dhcpcd exits.
|
||||
persistent
|
||||
|
||||
# Rapid commit support.
|
||||
# Safe to enable by default because it requires the equivalent option set
|
||||
# on the server to actually work.
|
||||
option rapid_commit
|
||||
|
||||
# A list of options to request from the DHCP server.
|
||||
option domain_name_servers, domain_name, domain_search, host_name
|
||||
option classless_static_routes
|
||||
# Most distributions have NTP support.
|
||||
option ntp_servers
|
||||
# Respect the network MTU.
|
||||
# Some interface drivers reset when changing the MTU so disabled by default.
|
||||
#option interface_mtu
|
||||
|
||||
# A ServerID is required by RFC2131.
|
||||
require dhcp_server_identifier
|
||||
|
||||
# Generate Stable Private IPv6 Addresses instead of hardware based ones
|
||||
slaac private
|
||||
|
||||
# A hook script is provided to lookup the hostname if not set by the DHCP
|
||||
# server, but it should not be run by default.
|
||||
nohook lookup-hostname
|
||||
35
home/pi/pivilion/config/interfaces.hotspot
Normal file
35
home/pi/pivilion/config/interfaces.hotspot
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
||||
|
||||
# Please note that this file is written to be used with dhcpcd
|
||||
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
|
||||
|
||||
# Include files from /etc/network/interfaces.d:
|
||||
source-directory /etc/network/interfaces.d
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
iface eth0 inet manual
|
||||
|
||||
#avoid stupid Rasbian static IP config via dhcpcd.conf (WTF???)
|
||||
|
||||
#auto eth0
|
||||
#iface eth0 inet static
|
||||
#address 192.168.1.5
|
||||
#netmask 255.255.255.0
|
||||
#gateway 192.168.1.1
|
||||
|
||||
allow-hotplug wlan0
|
||||
iface wlan0 inet static
|
||||
address 10.1.0.1
|
||||
netmask 255.255.255.0
|
||||
network 10.1.0.1
|
||||
broadcast 10.1.0.255
|
||||
|
||||
#allow-hotplug wlan0
|
||||
#iface wlan0 inet manual
|
||||
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
|
||||
#allow-hotplug wlan1
|
||||
#iface wlan1 inet manual
|
||||
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
35
home/pi/pivilion/config/interfaces.onion
Normal file
35
home/pi/pivilion/config/interfaces.onion
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
||||
|
||||
# Please note that this file is written to be used with dhcpcd
|
||||
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
|
||||
|
||||
# Include files from /etc/network/interfaces.d:
|
||||
source-directory /etc/network/interfaces.d
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
iface eth0 inet manual
|
||||
|
||||
#avoid stupid Rasbian static IP config via dhcpcd.conf (WTF???)
|
||||
|
||||
#auto eth0
|
||||
#iface eth0 inet static
|
||||
#address 192.168.1.5
|
||||
#netmask 255.255.255.0
|
||||
#gateway 192.168.1.1
|
||||
|
||||
#allow-hotplug wlan0
|
||||
#iface wlan0 inet static
|
||||
# address 10.1.0.1
|
||||
# netmask 255.255.255.0
|
||||
# network 10.1.0.1
|
||||
# broadcast 10.1.0.255
|
||||
|
||||
allow-hotplug wlan0
|
||||
iface wlan0 inet manual
|
||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
|
||||
allow-hotplug wlan1
|
||||
iface wlan1 inet manual
|
||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
24
home/pi/pivilion/config/rc.local.hotspot
Normal file
24
home/pi/pivilion/config/rc.local.hotspot
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
# Print the IP address
|
||||
_IP=$(hostname -I) || true
|
||||
if [ "$_IP" ]; then
|
||||
printf "My IP address is %s\n" "$_IP"
|
||||
fi
|
||||
# Display onion domain in MOTD
|
||||
cat /var/lib/tor/hidden_service/hostname > /home/pi/torname
|
||||
hostapd -d /etc/hostapd/hostapd.conf
|
||||
exit 0
|
||||
|
||||
|
||||
23
home/pi/pivilion/config/rc.local.onion
Normal file
23
home/pi/pivilion/config/rc.local.onion
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
# Print the IP address
|
||||
_IP=$(hostname -I) || true
|
||||
if [ "$_IP" ]; then
|
||||
printf "My IP address is %s\n" "$_IP"
|
||||
fi
|
||||
# Display onion domain in MOTD
|
||||
cat /var/lib/tor/hidden_service/hostname > /home/pi/torname
|
||||
exit 0
|
||||
|
||||
|
||||
14
home/pi/pivilion/config/wpa_supplicant.bkp
Normal file
14
home/pi/pivilion/config/wpa_supplicant.bkp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
|
||||
update_config=1
|
||||
|
||||
network={
|
||||
ssid="Inquiry Inc."
|
||||
psk="FormatC.artorg"
|
||||
key_mgmt=WPA-PSK
|
||||
}
|
||||
|
||||
network={
|
||||
ssid="APP-BusWiFi"
|
||||
psk="APP12345"
|
||||
key_mgmt=WPA-PSK
|
||||
}
|
||||
25
home/pi/pivilion/config/wpa_supplicant.conf
Normal file
25
home/pi/pivilion/config/wpa_supplicant.conf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
network={
|
||||
ssid="Tomato24"
|
||||
#psk="hajklab2016"
|
||||
psk=2982ad06a340d993a0baed4daa2928b0ceeb939bf9a1d3cd311cc81b21aa9dcc
|
||||
}
|
||||
network={
|
||||
ssid="Inquiry Inc."
|
||||
#psk="FormatCart.org"
|
||||
psk=33a8a7029b94df469ef4dd67fd8474b02892f15b77dd68dfb106ea197063d181
|
||||
}
|
||||
network={
|
||||
ssid="Inquiry Inc."
|
||||
#psk="FormatC.artorg"
|
||||
psk=4d6e49cef5d4ff65b89fd5100c38fa90a7c28d87298d7b32a70a033c2204b202
|
||||
}
|
||||
network={
|
||||
ssid="GLUO"
|
||||
#psk="1234567890123"
|
||||
psk=eb1a302ce03c3496a931683549e7040048f9b4b74ab0853611ded4e2ace5ac49
|
||||
}
|
||||
network={
|
||||
ssid="VODO1"
|
||||
#psk="12345678"
|
||||
psk=c7bad77ca2fdbf4df64823ca2453b7a9c7fd633ab7050e225f22a7082803c7d1
|
||||
}
|
||||
1
home/pi/pivilion/mode
Normal file
1
home/pi/pivilion/mode
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
13
home/pi/pivilion/scripts/hotspot
Normal file
13
home/pi/pivilion/scripts/hotspot
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
cat /home/pi/pivilion/config/dhcpcd.deny.wlan0 > /etc/dhcpcd.conf
|
||||
|
||||
sudo bash -c 'cat /home/pi/pivilion/config/interfaces.hotspot > /etc/network/interfaces'
|
||||
|
||||
sudo update-rc.d dnsmasq enable
|
||||
|
||||
sudo bash -c 'cat /home/pi/pivilion/config/rc.local.hotspot > /etc/rc.local'
|
||||
|
||||
echo "Your Rpi will reboot in hotspot mode"!
|
||||
|
||||
echo "hotspot" > /home/pi/pivilion/mode
|
||||
14
home/pi/pivilion/scripts/onion
Normal file
14
home/pi/pivilion/scripts/onion
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
cat /home/pi/pivilion/config/dhcpcd.orig > /etc/dhcpcd.conf
|
||||
|
||||
sudo bash -c 'cat /home/pi/pivilion/config/interfaces.onion > /etc/network/interfaces'
|
||||
|
||||
sudo update-rc.d dnsmasq disable
|
||||
|
||||
sudo bash -c 'cat /home/pi/pivilion/config/rc.local.onion > /etc/rc.local'
|
||||
|
||||
echo "The next time you reboot, your Pi will start in onion mode"!
|
||||
echo "Your onion domain is `cat /home/pi/pivilion/torname`"
|
||||
echo "Access info at `cat /home/pi/pivilion/torname`/info"
|
||||
echo "onion" > /home/pi/pivilion/mode
|
||||
11
home/pi/pivilion/scripts/pikey
Normal file
11
home/pi/pivilion/scripts/pikey
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Enter SSID"
|
||||
read name
|
||||
echo "Enter password"
|
||||
read password
|
||||
wpa_passphrase "$name" "$password" >> /home/pi/pivilion/config/wpa_supplicant.conf
|
||||
sudo bash -c "cp /home/pi/pivilion/config/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf"
|
||||
echo "Configured Wifi networks"
|
||||
sudo bash -c "cat /etc/wpa_supplicant/wpa_supplicant.conf"
|
||||
echo "If this is correct set your Pi to restart in onion mode by running the onion command!"
|
||||
33
home/pi/pivilion/scripts/pivilion
Normal file
33
home/pi/pivilion/scripts/pivilion
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
pause(){
|
||||
read -n1 -rsp $'\nPress any key to continue or Ctrl+C to exit...\n\n'
|
||||
}
|
||||
echo -e "\nWelcome to pivilion!"
|
||||
|
||||
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
|
||||
let secs=$((${upSeconds}%60))
|
||||
let mins=$((${upSeconds}/60%60))
|
||||
let hours=$((${upSeconds}/3600%24))
|
||||
let days=$((${upSeconds}/86400))
|
||||
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
|
||||
|
||||
# get the load averages
|
||||
read one five fifteen rest < /proc/loadavg
|
||||
echo "
|
||||
@@@@@@@@@@@@@@@@@@@ `date +"%A, %e %B %Y, %r"`
|
||||
@@@@@@, &@& *@@@@@@ `uname -srnmo`
|
||||
@@@@@@@. .@@@@@@@ Uptime.............: ${UPTIME}
|
||||
@@@@ .@@@. @@@@ Memory.............: `cat /proc/meminfo | grep MemFree | awk {'print $2'}`kB (Free) / `cat /proc/meminfo | grep MemTotal | awk {'print $2'}`kB (Total)
|
||||
@ &@@@@.@@@@# @ Load Averages......: ${one}, ${five}, ${fifteen} (1, 5, 15 min)
|
||||
@ @ . #@@@# . @ @ Running Processes..: `ps ax | wc -l | tr -d " "`
|
||||
@ @@@, # ,@@@ @ Manual / more info.: pivilion.net
|
||||
@@, @ ,@@ Onion Address......: `cat /home/pi/pivilion/torname`
|
||||
@@@@@#@@@@@@@#@@@@@ Running in `cat /home/pi/pivilion/mode` mode"
|
||||
pause
|
||||
echo -e "There are four commands for you to use: \n \n 1) \"pivilion\" will display this message. \n \n 2) \"onion\" will set your Pi to start in onion mode on next reboot. \n \n 3) \"hotspot\" will set your Pi to start in hotspot mode on next reboot. This is the default mode. \n Please remember to set the mode properly before each reboot or you might have to access your Pi via ethernet cable or screen. \n \n 4) \"pikey\" is used to setup a Wifi network and password to be used in onion mode. \n \n A more thorough explanation is available at pivilion.net.\n"
|
||||
|
||||
echo -e "The following is a usage scenario."
|
||||
pause
|
||||
echo "I'm to lazy to write that ATM. =P"
|
||||
pause
|
||||
exit 0
|
||||
0
home/pi/pivilion/torname
Normal file
0
home/pi/pivilion/torname
Normal file
Loading…
Add table
Add a link
Reference in a new issue