vi bt.sh
[ `hciconfig | awk '{if(match($0,"UP")}{print 1}}'` ] && echo bluetooth active || echo bluetooth down
[ esc] :wq
chmod +x bt.sh
./bt.sh