2020-09-19 12:28:56 +00:00
|
|
|
#!/bin/bash
|
2020-10-14 15:16:25 +00:00
|
|
|
|
|
|
|
# Check if root
|
|
|
|
[[ 0 -ne $UID ]] && { echo "Must run as root. Exiting."; exit; }
|
|
|
|
|
2020-10-16 06:43:23 +00:00
|
|
|
# Require a user for exploitation
|
|
|
|
DEFAULT=$(getent group 1000|cut -d: -f1)
|
|
|
|
read -e -i "$DEFAULT" -p "Please provide the system user who will own the project: " USER
|
|
|
|
|
|
|
|
getent group "$USER" &>/dev/null || { echo "Sorry, but '$USER' does not exist on this system. Exiting."; exit 2; }
|
|
|
|
|
2020-10-14 15:16:25 +00:00
|
|
|
# Propose some packages
|
|
|
|
echo -e "\nThe following packages are not mandatory, add them as needed.\n"
|
|
|
|
declare -a ADD_PACK
|
|
|
|
POS_PACK=( htop nginx screen ssh ssl-cert supervisor syncthing tmux )
|
|
|
|
POS_PACK_LEN=${#POS_PACK[@]}
|
|
|
|
for i in ${!POS_PACK[@]} ; do
|
|
|
|
pack=${POS_PACK[i]}
|
|
|
|
read -e -n 1 -p "$((i+1))/${POS_PACK_LEN} Add package ${pack} ? [Y/n]: "
|
|
|
|
REPLY=${REPLY:-Y}
|
|
|
|
[[ "Y" == ${REPLY^^} ]] && ADD_PACK+=(${pack})
|
|
|
|
done
|
|
|
|
|
|
|
|
# Propose the install
|
|
|
|
PACK_LIST=$( echo "cmake git libasound2-dev libjack-dev libsdl1.2-dev network-manager portaudio19-dev python3-dev python3-pip python3-rtmidi redis-server ${ADD_PACK[@]}" | sort )
|
|
|
|
echo -e "\nYou are goind to install:\n$( for pack in ${PACK_LIST[@]}; do echo ' * '$pack; done; )\n"
|
|
|
|
read -e -n1 -p "OK? [Y/n]: "
|
|
|
|
REPLY=${REPLY:-Y}
|
|
|
|
[[ "N" == ${REPLY^^} ]] && exit
|
|
|
|
|
|
|
|
# Run the install
|
2020-10-14 16:12:35 +00:00
|
|
|
apt install -y --no-install-recommends $PACK_LIST
|
2020-10-14 15:16:25 +00:00
|
|
|
pip3 install setuptools
|
|
|
|
pip3 install DMXEnttecPro mido numpy pysimpledmx redis scipy
|
|
|
|
git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install
|
|
|
|
cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build .
|
|
|
|
cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build .
|
|
|
|
cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ
|
2020-10-16 06:43:23 +00:00
|
|
|
chown -R $USER /opt/LJ
|