Add zsh, add distro detection
This commit is contained in:
parent
006bdaee16
commit
d1874677cf
10 changed files with 396 additions and 7 deletions
|
@ -1,9 +1,29 @@
|
|||
#!/bin/bash
|
||||
#!/bin/zsh
|
||||
|
||||
# Wait until enter is pressed
|
||||
# Modify constants as needed
|
||||
GITEA_URL = "https://git.askiiart.net"
|
||||
REAL_NAME = "askiiart"
|
||||
EMAIL = "dev@askiiart.net"
|
||||
|
||||
# Note: This waits until enter is pressed
|
||||
# read -p "Press Enter to continue" < /dev/tty
|
||||
|
||||
sudo dnf install git -y
|
||||
declare -A osInfo;
|
||||
osInfo[/etc/redhat-release]=yum
|
||||
osInfo[/etc/arch-release]=pacman
|
||||
osInfo[/etc/gentoo-release]=emerge
|
||||
osInfo[/etc/SuSE-release]=zypp
|
||||
osInfo[/etc/debian_version]=apt-get
|
||||
osInfo[/etc/alpine-release]=apk
|
||||
|
||||
for f in ${(k)osInfo}
|
||||
do
|
||||
if [[ -f $f ]]; then
|
||||
echo "Package manager: ${osInfo[$f]}"
|
||||
fi
|
||||
done
|
||||
|
||||
sudo ${osInfo[$f]} install git -y
|
||||
|
||||
# Install git credential manager
|
||||
curl -L https://aka.ms/gcm/linux-install-source.sh | sh
|
||||
|
@ -22,8 +42,8 @@ echo $KEY_ID
|
|||
|
||||
# Export GPG key
|
||||
gpg --armor --export $KEY_ID
|
||||
echo This is the exported key, copy it and put it in Git*
|
||||
echo Gitea URL: https://git.askiiart.net/user/settings/keys
|
||||
echo This is the exported key, copy it and put it in GitHub/Gitea/whatever
|
||||
echo Gitea URL: ${GITEA_URL}/user/settings/keys
|
||||
echo GitHub URL: https://github.com/settings/gpg/new
|
||||
read -p "Press enter when you're done" < /dev/tty
|
||||
|
||||
|
@ -39,8 +59,8 @@ ssh-keygen -f ~/.ssh/id_rsa -N "" -t rsa
|
|||
# Get SSH key
|
||||
echo
|
||||
cat ~/.ssh/id_rsa.pub
|
||||
echo This is the SSH public key, copy it and put it in Gitea/GitHub/whatever
|
||||
echo Gitea URL: https://git.askiiart.net/user/settings/keys
|
||||
echo This is the SSH public key, copy it and put it in GitHub/Gitea/whatever
|
||||
echo Gitea URL: ${GITEA_URL}/user/settings/keys
|
||||
echo GitHub URL: https://github.com/settings/ssh/new
|
||||
|
||||
echo Fixing permissions, removing temp files...
|
Loading…
Add table
Add a link
Reference in a new issue