Compare commits
1 Commits
main
...
aee75eefee
| Author | SHA1 | Date | |
|---|---|---|---|
| aee75eefee |
@@ -10,4 +10,4 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads
|
|||||||
example:
|
example:
|
||||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/code_server.sh)"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/code_server.sh)"
|
||||||
|
|
||||||
bash -c "$(curl -fsSL https://git.galoz.site/galoz/proxy/raw/branch/main/set_ps1.sh)"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/docker_portainer.sh)"
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Define the public key to add
|
|
||||||
PUBLIC_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb2LEZS8zM3Pd2irwMOmrMhUB6ZMcIwyC0aWJIqTVIQVxEm3FIgN8ugJDqyv9vE6efwrAmbTxwi/bcXqKbo+ci2CRBrryvSzZDBsBMQYbDc3zervduLt9MQSjOHKxHlBH73G7qs0cyXBroO+Rpe+5t0WtJkR5MPNQf7+s07Y83viBF31oh5a3rGYvbxaLd0hOW622o/2/thVQS9Q1FlMtILA9Hn5PAWp/LZcTzFnqeVbstznzBvSmjfvvLxF9Ujeldm2cPUD8OXKjfMX4K5gGaGp+p8vI5rijUTdX1Yj7iKAM+NGXpjh90o4PCRfOSW5mP2mf31jhsFRJRxiKxPZAJ rsa-key-20250707" # <--- REPLACE THIS WITH YOUR ACTUAL PUBLIC KEY
|
|
||||||
|
|
||||||
# Define file paths
|
|
||||||
SSH_DIR="$HOME/.ssh"
|
|
||||||
AUTHORIZED_KEYS_FILE="$SSH_DIR/authorized_keys"
|
|
||||||
|
|
||||||
# Create .ssh directory and set permissions if it doesn't exist
|
|
||||||
mkdir -p "$SSH_DIR" && chmod 700 "$SSH_DIR" || { echo "Error: Could not create or set permissions for $SSH_DIR. Exiting."; exit 1; }
|
|
||||||
|
|
||||||
# Create authorized_keys file and set permissions if it doesn't exist
|
|
||||||
touch "$AUTHORIZED_KEYS_FILE" && chmod 600 "$AUTHORIZED_KEYS_FILE" || { echo "Error: Could not create or set permissions for $AUTHORIZED_KEYS_FILE. Exiting."; exit 1; }
|
|
||||||
|
|
||||||
# Check if the key already exists to prevent duplicates
|
|
||||||
if grep -qF "$PUBLIC_KEY" "$AUTHORIZED_KEYS_FILE"; then
|
|
||||||
echo "Key already exists in $AUTHORIZED_KEYS_FILE. No changes made."
|
|
||||||
else
|
|
||||||
# Add the key
|
|
||||||
echo "$PUBLIC_KEY" >> "$AUTHORIZED_KEYS_FILE"
|
|
||||||
echo "Key successfully added to $AUTHORIZED_KEYS_FILE."
|
|
||||||
fi
|
|
||||||
24
set_ps1.sh
24
set_ps1.sh
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Define the new PS1 string
|
|
||||||
# Example: [User@Host CurrentDir]$
|
|
||||||
# This example uses colors: green for user@host, blue for directory.
|
|
||||||
# \u: username
|
|
||||||
# \h: hostname (short)
|
|
||||||
# \w: current working directory (basename only)
|
|
||||||
# \$: # if root, $ otherwise
|
|
||||||
NEW_PS1='\[\e[1m\]\[\e[90m\]0\[\e[0;32m\]\u@\[\e[36m\]\h\[\e[90m\]:\[\e[33m\]\w\[\e[90m\]$ \[\e[m\]'
|
|
||||||
|
|
||||||
# The line to be added to .bashrc
|
|
||||||
PS1_LINE="PS1='${NEW_PS1}'"
|
|
||||||
|
|
||||||
# Check if the line already exists in .bashrc to prevent duplicates
|
|
||||||
if grep -qE "^PS1=" ~/.bashrc; then
|
|
||||||
echo "PS1 setting already exists in ~/.bashrc. No changes made."
|
|
||||||
else
|
|
||||||
# Append the PS1 line to .bashrc
|
|
||||||
echo -e "\n" >> ~/.bashrc # Ensure there's a newline before adding
|
|
||||||
echo "${PS1_LINE}" >> ~/.bashrc
|
|
||||||
echo "PS1 setting has been added to ~/.bashrc."
|
|
||||||
echo "Please open a new terminal or run 'source ~/.bashrc' for changes to take effect."
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user