astroport/.install/sys_checkOS.sh

15 lines
601 B
Bash
Raw Normal View History

2020-05-19 18:40:50 +02:00
#!/bin/bash
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
ipfsnodeid=$(ipfs id -f='<id>\n')
myProfile="/home/$YOU/.zen/ipfs/.$ipfsnodeid/profile"
## Check system kind
[[ $(uname -a | grep arm) ]] && ARM=yes || unset ARM
if [[ $(grep -E 'stretch|18.|19.' /etc/os-release) ]]; then OS=stretch;
elif [[ $(grep buster /etc/os-release) ]]; then OS=buster;
else echo "${c_red}OS not supported$c_"; exit 1; fi
[[ ! grep "OS=" $myProfile ]] && echo "OS=$OS" >> $myProfile
[[ ! grep "ARM=" $myProfile && -n $ARM ]] && echo "ARM=$ARM" >> $myProfile