code-server-dotnet: initial release

This commit is contained in:
aptalca
2020-10-15 07:49:11 -04:00
parent 69f8a2efb7
commit 3259217e9d
7 changed files with 117 additions and 73 deletions
+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/with-contenv bash
# Determine if setup is needed
if [ -d /dotnet ]; then
# remove existing install if updating
if ls -d /dotnet_* >/dev/null 2>&1; then
echo "deleting" $(ls -d /dotnet_*)
rm -rf /dotnet_*
fi
DOTNET_VERSIONS=$(cat /dotnet/versions.txt)
ARCH=$(uname -m)
for i in $DOTNET_VERSIONS; do
mkdir -p "/dotnet_${i}"
tar xzf "/dotnet/dotnetsdk_${i}_${ARCH}.tar.gz" -C "/dotnet_${i}"
done
rm -rf /dotnet
# symlink latest dotnet binary
DOTNET_LATEST=$(echo "$DOTNET_VERSIONS" | awk '{print $1}')
rm -rf /usr/local/bin/dotnet
ln -s /dotnet_${DOTNET_LATEST}/dotnet /usr/local/bin/dotnet
echo "
****************************************************
****************************************************
**
**
DOTNET SDK versions installed:
$(echo $DOTNET_VERSIONS | sed 's| |\n |g')
**
**
Binary locations are:"
for i in $DOTNET_VERSIONS; do
echo " /dotnet_${i}/dotnet"
done
echo " **
**
Version $DOTNET_LATEST is symlinked from /usr/local/bin/dotnet and can be called from anywhere via \"dotnet\"
**
**
****************************************************
****************************************************"
# symlink other dotnet installs for access through latest binary
for i in {2..5}; do
DOTNET_OTHER_SDK_VERSION="$(echo $DOTNET_VERSIONS | awk -v var=${i} '{print $var}')"
if [ -n "$DOTNET_OTHER_SDK_VERSION" ]; then
DOTNET_OTHER_RUNTIME_VERSION="$(ls /dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.NETCore.App)"
echo "**** Symlinking sdk version ${DOTNET_OTHER_SDK_VERSION} and runtime version ${DOTNET_OTHER_RUNTIME_VERSION} ****"
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.NETCore.App/${DOTNET_OTHER_RUNTIME_VERSION}" "/dotnet_${DOTNET_LATEST}/shared/Microsoft.NETCore.App/${DOTNET_OTHER_RUNTIME_VERSION}"
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.AspNetCore.App/${DOTNET_OTHER_RUNTIME_VERSION}" "/dotnet_${DOTNET_LATEST}/shared/Microsoft.AspNetCore.App/${DOTNET_OTHER_RUNTIME_VERSION}"
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/sdk/${DOTNET_OTHER_SDK_VERSION}" "/dotnet_${DOTNET_LATEST}/sdk/${DOTNET_OTHER_SDK_VERSION}"
else
break
fi
done
else
echo "**** Existing dotnet install is up to date, skipping ****"
fi
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/with-contenv bash
# Determine if setup is needed
if [ ! -f /usr/local/lib/python***/dist-packages/sshuttle ] && \
[ -f /usr/bin/apt ]; then
## Ubuntu
apt-get update
apt-get install --no-install-recommends -y \
iptables \
openssh-client \
python3 \
python3-pip
pip3 install sshuttle
fi
if [ ! -f /usr/lib/python***/site-packages/sshuttle ] && \
[ -f /sbin/apk ]; then
# Alpine
apk add --no-cache \
iptables \
openssh \
py3-pip \
python3
pip3 install sshuttle
fi
chown -R root:root /root
chmod -R 600 /root/.ssh
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/with-contenv bash
sshuttle --dns --remote root@${HOST}:${PORT} 0/0 -x 172.17.0.0/16