info_tfgrid/scripts/hero_mdbook.sh
2024-02-15 14:55:04 -05:00

38 lines
1.3 KiB
Bash

#!/bin/bash
sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf
sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
apt update && apt upgrade -y
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
export PATH=$PATH:/root/.cargo/bin
apt install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install redis -y
apt install pkg-config -y
apt-get install gcc -y
apt install libssl-dev
curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh
bash /tmp/hero_install.sh
eval $(ssh-agent)
hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript
cd /root/hero/var/mdbuild/duniayetu
mdbook build
cat <<EOF
* * * * *
The script has been successfully completed.
To see the mdbook live on your browser with the SSH tunnel,
run the following command with the proper port (here we use 3333).
mdbook serve --port 3333
Happy mdbooking!
* * * * *
EOF
return 2> /dev/null; exit