Merge branch 'main' of https://git.galoz.site/galoz/proxy
This commit is contained in:
@@ -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://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/docker_portainer.sh)"
|
bash -c "$(curl -fsSL https://git.galoz.site/galoz/proxy/raw/branch/main/set_ps1.sh)"
|
||||||
|
|||||||
35
set_ps1.sh
Normal file
35
set_ps1.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
# Check if .bashrc exists before sourcing
|
||||||
|
if [ -f ~/.bashrc ]; then
|
||||||
|
echo "Sourcing ~/.bashrc..."
|
||||||
|
source ~/.bashrc
|
||||||
|
# Or equivalently:
|
||||||
|
# . ~/.bashrc
|
||||||
|
echo "~/.bashrc has been sourced."
|
||||||
|
else
|
||||||
|
echo "~/.bashrc not found. Cannot source it."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user