Skip to content

Instantly share code, notes, and snippets.

@jsntn
Forked from sdhuang32/install-git-on-qts.sh
Created May 27, 2022 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsntn/bf0f002cda668b5b8b69c0733024c615 to your computer and use it in GitHub Desktop.
Save jsntn/bf0f002cda668b5b8b69c0733024c615 to your computer and use it in GitHub Desktop.
#!/bin/bash
BASE_DIR=$(dirname $0)
BUILD_SCRIPT_NAME="build-git.sh"
BUILD_SCRIPT="${BASE_DIR}/${BUILD_SCRIPT_NAME}"
if [ ! -d /share/Public/toolchain ]; then
mkdir /share/Public/toolchain
fi
if [ -z "$(system-docker ps | grep 'builder')" ]; then
system-docker run --name builder --privileged -v /share/Public/toolchain:/share/Public/toolchain -d sdhuang32/c7-systemd
fi
system-docker cp ${BUILD_SCRIPT} builder:/root/${BUILD_SCRIPT_NAME}
system-docker exec -t builder bash /root/${BUILD_SCRIPT_NAME}
if [ -z "$(cat /etc/profile | grep 'toolchain')" ]; then
echo "PATH=/share/Public/toolchain/bin:\$PATH" >> /etc/profile
fi
system-docker stop builder; system-docker rm builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment