Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NordVPN improvements | Change up and down script and add item to DietPi-Banner #3084

Merged
merged 22 commits into from
Sep 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dietpi/func/dietpi-banner
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
'Custom banner entry'
'Display DietPi useful commands?'
'MOTD'
'NordVPN status'

)
# Set defaults
aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1)
aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0)

COLOUR_RESET='\e[0m'
aCOLOUR=(
Expand Down Expand Up @@ -184,7 +185,7 @@ $GREEN_LINE"

Print_Banner(){

# - Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen
# Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen
[[ ${aENABLED[2]} != 1 && ${aENABLED[12]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals

printf '\ec' # clear current terminal screen
Expand All @@ -195,8 +196,9 @@ $GREEN_LINE"
(( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPARATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" # 2: CPU temp
(( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPARATOR $(hostname -f 2>&1)" # 3: Hostname
(( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPARATOR $(hostname -y 2>&1)" # 4: Domain name
Print_Local_Ip
Print_Local_Ip # 5: LAN IP
(( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://dietpi.com/myip.php 2>&1)" # 6: WAN IP # Move this to /DietPi/dietpi/.network?
(( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/DietPi/dietpi/misc/dietpi-nordvpn status 2>&1)" # 13: DietPi-NordVPN connection status
(( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" # 7: Freespace (RootFS)
(( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # 8: Freespace (DietPi userdata)
(( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://wttr.in/?format=4 2>&1)" # 9: Weather
Expand All @@ -209,7 +211,7 @@ $GREEN_LINE"

if . $fp_motd &> /dev/null && [[ $motd ]]; then

echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" # 12: MOTD
echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" # 12: MOTD

else

Expand All @@ -223,7 +225,7 @@ $GREEN_LINE"
echo -e "$GREEN_LINE\n"

Print_Credits
(( ${aENABLED[11]} == 1 )) && Print_Useful_Commands
(( ${aENABLED[11]} == 1 )) && Print_Useful_Commands # 11: Useful commands

}

Expand Down
Loading