mirror of
https://github.com/kasmtech/terraform.git
synced 2026-01-23 18:36:39 +00:00
30 lines
813 B
Bash
30 lines
813 B
Bash
#!/bin/bash
|
|
set -ex
|
|
echo "Starting Kasm Workspaces Install"
|
|
|
|
## Create Swap partition
|
|
fallocate -l "${swap_size}"g /var/kasm.swap
|
|
chmod 600 /var/kasm.swap
|
|
mkswap /var/kasm.swap
|
|
swapon /var/kasm.swap
|
|
echo '/var/kasm.swap swap swap defaults 0 0' | tee -a /etc/fstab
|
|
|
|
cd /tmp
|
|
|
|
PRIVATE_IP=(`hostname -I | cut -d ' ' -f1 | tr -d '\\n'`)
|
|
|
|
wget ${kasm_build_url} -O kasm_workspaces.tar.gz
|
|
tar -xf kasm_workspaces.tar.gz
|
|
|
|
sleep 30
|
|
bash kasm_release/install.sh -e -U ${user_password} -P ${admin_password} -p $PRIVATE_IP -m $PRIVATE_IP
|
|
|
|
echo -e "${nginx_cert_in}" > /opt/kasm/current/certs/kasm_nginx.crt
|
|
echo -e "${nginx_key_in}" > /opt/kasm/current/certs/kasm_nginx.key
|
|
|
|
echo "Stopping and restarting Kasm services to apply certificates..."
|
|
/opt/kasm/bin/stop
|
|
docker rm $(docker ps -aq)
|
|
/opt/kasm/bin/start
|
|
|
|
echo "Done"
|