Created
May 5, 2020 18:59
-
-
Save syoh/391eec8d1ea15d4934355bac38a681ba to your computer and use it in GitHub Desktop.
bootstrap script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OSNAME=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) | |
USERNAME=$(echo $HOME | cut -d"/" -f3) | |
[[ $(echo $USERNAME | grep -c jovyan) != 0 ]] && ISJOVYAN=true || ISJOVYAN=false | |
[[ $(groups | grep -c sudo) != 0 ]] && ISSUDOER=true || ISSUDOER=false | |
[[ $WSL_DISTRO_NAME ]] && ISWSL=true || ISWSL=false | |
## [[ "$OSNAME" == "debian" ]] && ISDEBIAN=true || ISDEBIAN=false | |
## [[ "$OSNAME" == "ubuntu" ]] && ISUBUNTU=true || ISUBUNTU=false | |
echo "####" | |
echo "OSNAME : $OSNAME" | |
echo "USERNAME: $USERNAME" | |
echo "ISJOVYAN: $ISJOVYAN" | |
echo "ISSUDOER: $ISSUDOER" | |
echo "ISWSL : $ISWSL" | |
echo "####" | |
[ "$ISSUDOER" = true ] && \ | |
echo Install general stuff like wget curl | |
[ "$ISSUDOER" = true ] && [ "$ISJOVYAN" = false ] && \ | |
echo Install non-docker stuff like zathura | |
[ "$ISWSL" = true ] && \ | |
echo Set WSL stuff like DISPLAY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment