dont attempt to configure a tilde if we are already using it

This commit is contained in:
sose 2020-09-26 13:24:18 -07:00
parent 6db7d0d90b
commit 980c140169
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,12 @@ setup_tildelinux() {
echo "What is your username for $tilde_name?" echo "What is your username for $tilde_name?"
read tilde_username read tilde_username
if grep -q "$tilde_username@$tilde_name" /tilde/current_tilde
then
echo "You are already using $tilde_name as $tilde_username! Exiting..."
exit
fi
if ! grep -q "$tilde_username@$tilde_name" /tilde/tildes if ! grep -q "$tilde_username@$tilde_name" /tilde/tildes
then then
echo "Now you will need to provide tildelinux with your ssh private key" echo "Now you will need to provide tildelinux with your ssh private key"

View File

@ -70,5 +70,7 @@ configure_user() {
sed -i "s|{{ TILDE_USERNAME }}|$tilde_username|g" "/tilde/tildes" sed -i "s|{{ TILDE_USERNAME }}|$tilde_username|g" "/tilde/tildes"
sed -i "s|{{ KEY_FILE }}|$key_file|g" "/tilde/tildes" sed -i "s|{{ KEY_FILE }}|$key_file|g" "/tilde/tildes"
echo "$tilde_username@$tilde_name" > /tilde/current_tilde
systemctl daemon-reload systemctl daemon-reload
} }