pivilion/usr/local/bin/pivilion
2022-06-18 22:42:53 +00:00

45 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
pause(){
read -n1 -rsp $'\nPress any key to continue or Ctrl+C to exit...\n\n'
}
sudo bash -c 'cat /var/lib/tor/hidden_service/hostname > /home/pi/pivilion/torname'
sudo bash -c 'echo "onion" > /home/pi/pivilion/mode'
sudo chown -R pi:www-data /var/www/html/pivilion/gen
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. This is the default mode. \n \n 3) \"hotspot\" will set your Pi to start in hotspot mode on next reboot. \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 -e "You are in a queue in a bank and they let you have their Wifi password. It's taking ages...\n\nYou already setup your gallery by either using our PHP gallery generation script or by uploading your own website to /var/www/html on your Pivilion box and set your Pi to run in hotspot mode."
pause
echo -e "All you have to do now is \n - connect your phone to your Pivilion box, powered by a battery pack in your backpack, \n - ssh to it using a terminal emulator for your phone, \n - run pikey to input the network SSID and password, \n - run onion to set Pivilion to run as a tor hidden service on the next boot and \n - reboot "
pause
echo -e "And there you have it! \nYou just hosted an online darknet exhibition powered by your local bank! =P"
pause
echo -e "For detailed info and support visit http://pivilion.net or https://gitlab.com/hacklab01/pivilion/"
exit 0