migrate/post-install

39 lines
804 B
Plaintext
Raw Normal View History

2022-11-22 18:40:45 +00:00
#!/usr/bin/env bash
# set some variables
homeDir=$HOME
echo $homeDir
hostname=$HOSTNAME
echo $hostname
os=$(lsb_release -d| awk '{print $2}') # definitely works on Fedora
echo $os
2022-11-22 18:48:48 +00:00
2022-11-22 18:40:45 +00:00
# ensure some directories exist
gitDir=$homeDir"/git"
[ ! -d $gitDir ] && mkdir -p $gitDir || echo $gitDir" already exists"
sshDir=$homeDir"/.ssh"
[ ! -d $sshDir ] && mkdir -p $sshDir || echo $sshDir" already exists"
configDir=$homeDir"/.config"
[ ! -d $configDir ] && mkdir -p $configDir || echo $configDir" already exists"
# create an ssh key, for use with git/github
2022-11-22 18:48:48 +00:00
ssh-keygen -t ed25519 -f $sshDir"/id_ed25519_git" -N ''
2022-11-22 19:01:23 +00:00
# check package manager
if [[ $os == "Ubuntu" ]]; then
sudo apt install $(cat packages)`
elif [[ $os == "Fedora" ]] then
echo "test"
else
echo "OS not yet supported"
fi