Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

using armbian variables in a script

Featured Replies

Hi forum members,
on my interactive bash I can use the armbian variables like BOARD , BOARD_NAME or BOARDFAMILY, but these variables ard not seen when I try to use them in a bash script.
 

Armbian_Vars.thumb.png.cd5fbd24be53eefff35a5918b08b7203.png


Any hints ?

there must be a difference between $BOARD and $TERM or $PWD

because in a script it works for 

$TERM and $PWD

 

I tought when it is a "gobal" variabel which was exported via export=
it should work, but I also got this problem today with a script while trying to set a global environment variable :(
My variable is only useable in the script and wehen it ends it isnt global anymore :(

Havent also found the "magic searchword" today :(

in case this example helps

 

lane@hambone:~$ cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=orangepi3
BOARD_NAME="Orange Pi 3"
BOARDFAMILY=sun50iw6
BUILD_REPOSITORY_URL=https://github.com/armbian/rkbin
BUILD_REPOSITORY_COMMIT=3e533c9
DISTRIBUTION_CODENAME=bionic
DISTRIBUTION_STATUS=supported
VERSION=20.05.0-trunk.038
LINUXFAMILY=sunxi64
BRANCH=current
ARCH=arm64
IMAGE_TYPE=nightly
BOARD_TYPE=conf
INITRD_ARCH=arm64
KERNEL_IMAGE_TYPE=Image


lane@hambone:~$ source /etc/armbian-release
lane@hambone:~$ echo "${BOARD_NAME} ${LINUXFAMILY}"
Orange Pi 3 sunxi64

 

I thought it will work without a file :(
Ok with a source-file my script-idea of a startrek-lightline for lcd4linux is working now with the following bash script (which is used by lcd4linux):
 

#!/bin/bash -e

lightfile="/var/lightactual.val"

if [ -f "$lightfile" ]; then
        # found - do nothing
        sleep 0
else
        echo 'lightactual=0' > $lightfile
fi

source $lightfile

# echo 'val of lightactual='$lightactual

lightline[0]='---------##---------'
lightline[1]='--------#--#--------'
lightline[2]='-------#----#-------'
lightline[3]='------#------#------'
lightline[4]='-----#--------#-----'
lightline[5]='----#----------#----'
lightline[6]='---#------------#---'
lightline[7]='--#--------------#--'
lightline[8]='-#----------------#-'
lightline[9]='#------------------#'
echo ${lightline[$lightactual]}

lightactual=$((lightactual+1))

if [ $lightactual -eq 10 ]
then
  lightactual=0
fi

echo 'lightactual='$lightactual > $lightfile
# echo  "lightactual after count-up="$lightactual

 

The BOARD etc variables are imported in /etc/profile.d/armbian-check-first-login.sh, which in turn is only loaded in interactive login shells.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.