Changeset - b3645e4abeac
[Not reviewed]
0 1 0
x - 1 month ago 2025-09-12 14:16:46
xbr@c3l.lu
add: colors to freifunk_root.sh
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
build_script/freifunk_root.sh
Show inline comments
 
@@ -3,13 +3,13 @@ set +xe
 

	
 
username=user
 
ssh_login_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOLFCOqpPOTZEQiWcY9TyVQnMoc5bCYlxLaRKhiB/uxo xbr 2024-06-16"
 
projects_c3l_pubkey="|1|X2M4bHKf8E+plhJ6KoDZzCfw5LI=|EpHLDWOmOq4SLelYTGd8SH+7hvU= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXfRmGmfbxPoErs5lpTnz+PZRQdh0QvPGTiswxFkXOx"
 

	
 
log() {
 
    printf "[-] %s\n" "$@"
 
    printf "\033[33m[-] %s\033[0m\n" "$@"
 
}
 

	
 
install_packages() {
 
    log "Installing packages..."
 

	
 
    apt update && apt upgrade -y
 
@@ -36,15 +36,17 @@ ssh_setup() {
 
    home_dir=""; eval home_dir=~$username
 
    echo "$ssh_login_key" >> "$home_dir/.ssh/authorized_keys"
 
    chmod -v 600 "$home_dir/.ssh/authorized_keys"
 
    echo "$projects_c3l_pubkey" >> "$home_dir/.ssh/known_hosts"
 
    chmod -v 644 "$home_dir/.ssh/known_hosts"
 

	
 
    echo "The user's SSH pubkey is the following:"
 
    cat "$home_dir/.ssh/id_ed25519.pub"
 
    echo
 
    echo "Do not forget to add it to projects.c3l.lu"
 
    log "The user's SSH pubkey is the following:"
 
    printf "\n\033[32;1m"
 
    cat "$home_dir/.ssh/id_ed25519.pub"
 
    printf "\033[0m\n"
 
    log "Do not forget to add it to projects.c3l.lu"
 
}
 

	
 
install_packages
 
create_user
 
ssh_setup
0 comments (0 inline, 0 general)