mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2026-02-04 07:40:48 +00:00
first Pivivlion config and scripts
This commit is contained in:
parent
e046535f8c
commit
1599a2b753
61 changed files with 7014 additions and 0 deletions
13
home/pi/scripts/hotspot
Normal file
13
home/pi/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/scripts/onion
Normal file
14
home/pi/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/scripts/pikey
Normal file
11
home/pi/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/scripts/pivilion
Normal file
33
home/pi/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue