a2cloud/setup/a2cloudrc
T. Joseph Carter 55c53b9c10 Clarify license on script files
As noted, Ivan has agreed to allow these scripts to be relicensed under
CC0.  We have one file under LGPL (a unit file we lifted wholesake from
systemd) and the ADTPro wrapper which I'm pretty sure Ivan wrote, but if
he didn't we need to fix its license to be the same as ADTPro.

Either way, to the best of my knowledge, this resolves the question of
how things are licensed explicitly.  (Closes #21)
2018-06-24 21:48:42 -07:00

45 lines
1.6 KiB
Bash
Executable File

#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
# a2cloudrc - a2cloud user environment script for bash
#
# To the extent possible under law, T. Joseph Carter and Ivan Drucker have
# waived all copyright and related or neighboring rights to the a2cloud
# scripts themselves. Software used or installed by these scripts is subject
# to other licenses. This work is published from the United States.
source /usr/local/etc/a2cloud-aliases
if [[ -f /usr/local/java/bin/java ]]; then
export JAVA_HOME=/usr/local/java
elif [[ -f /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/java ]]; then # RPi
export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt
elif [[ -f /usr/lib/jvm/java-8-oracle/bin/java ]]; then # webupd8
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
elif [[ -f /usr/lib/jvm/java-8-oracle/jre/bin/java ]]; then # Ubuntu 14.04 RPi2
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre
elif [[ -f /usr/lib/jvm/jdk-7-oracle-armhf/bin/java ]]; then # RPi
export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle-armhf
elif [[ -f /usr/lib/jvm/jdk-7-oracle/bin/java ]]; then # webupd8
export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle
fi
[[ ! $(grep java <<< $PATH) ]] && PATH=$PATH:$JAVA_HOME/bin
if [[ -f /usr/local/etc/a2cloud-lang ]]; then
lang8bit=$(cat /usr/local/etc/a2cloud-lang)
else
lang8bit=C
fi
if [[ ${TERM:0:6} == "screen" ]]; then
myTTY=$(ps hp $(ps hp $(ps hp $$ -o ppid) -o ppid) -o tty)
else
myTTY=$(tty)
export ttyTERM="$TERM"
fi
if [[ $(grep ttyUSB <<< $myTTY) || $(grep ttyAMA <<< $myTTY) ]]; then
LANG=$lang8bit
fi
if [[ ${TERM:0:6} == "screen" ]]; then
TERM=$ttyTERM
fi