Jump to content

Recommended Posts

Posted

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 ?

Posted

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 :(

Posted

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

 

Posted

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

 

Posted

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.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines