mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2025-04-30 00:57:16 +00:00
36 lines
1.8 KiB
Bash
Executable File
36 lines
1.8 KiB
Bash
Executable File
#!/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
|