prompt fix
This commit is contained in:
+7
-7
@@ -145,7 +145,11 @@ EOT
|
|||||||
echo "Ustawienie kluczy logowania do DirectAdmina i kluczy SSH hitme"
|
echo "Ustawienie kluczy logowania do DirectAdmina i kluczy SSH hitme"
|
||||||
|
|
||||||
daupdate klucze
|
daupdate klucze
|
||||||
|
|
||||||
|
if ! grep -q '^Match User root' /etc/ssh/sshd_config; then
|
||||||
daupdate keyput
|
daupdate keyput
|
||||||
|
fi
|
||||||
|
|
||||||
cd $DAPOSTINSTALL_DIR
|
cd $DAPOSTINSTALL_DIR
|
||||||
|
|
||||||
echo "Instalacja Modsecurity i regułek malware experts"
|
echo "Instalacja Modsecurity i regułek malware experts"
|
||||||
@@ -605,19 +609,15 @@ $DADIR/plugins/redis_management/scripts/install.sh
|
|||||||
cd $DAPOSTINSTALL_DIR
|
cd $DAPOSTINSTALL_DIR
|
||||||
|
|
||||||
echo "Instalacja IMAPsync"
|
echo "Instalacja IMAPsync"
|
||||||
dnf -y install --enablerepo=powertools imapsync
|
dnf -y install imapsync
|
||||||
mkdir $DADIR/plugins/imapsync
|
mkdir $DADIR/plugins/imapsync
|
||||||
tar -zxf imapsync.tar.gz -C $DADIR/plugins/imapsync
|
tar -zxf imapsync.tar.gz -C $DADIR/plugins/imapsync
|
||||||
$DADIR/plugins/imapsync/scripts/install.sh
|
$DADIR/plugins/imapsync/scripts/install.sh
|
||||||
echo 'imapsync=type=checkbox&string=IMAPsync migrations (plugin)&desc=Allow access to imapsync migrations&default=yes' >> /usr/local/directadmin/data/admin/custom_package_items.conf
|
|
||||||
echo 'imapsync=ON' >> /usr/local/directadmin/data/users/admin/user.conf
|
echo 'imapsync=ON' >> /usr/local/directadmin/data/users/admin/user.conf
|
||||||
cp lang_pl.php $DADIR/plugins/imapsync/lang
|
cp lang_pl.php $DADIR/plugins/imapsync/lang
|
||||||
|
|
||||||
# echo "Dodanie kolorowego prompta hitme"
|
echo "instalacja promptów"
|
||||||
# echo "PS1='\[\e[0;1;38;5;46m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0;1;97m\]\W\[\e[0m\]]\[\e[0;38;5;46m\]$ \[\e[0m\]'" | sudo tee -a /etc/profile
|
sh prompt.sh
|
||||||
|
|
||||||
# echo "dodanie kolorowego prompta dla roota"
|
|
||||||
# echo "PS1='\[\e[0;1;91m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0;1;97m\]\W\[\e[0m\]]\[\e[0;1m\]# \[\e[0m\]'" | sudo tee -a /root/.bash_profile
|
|
||||||
|
|
||||||
echo "never_commands=custombuild:updates:license" >> /usr/local/directadmin/conf/directadmin.conf
|
echo "never_commands=custombuild:updates:license" >> /usr/local/directadmin/conf/directadmin.conf
|
||||||
systemctl restart directadmin
|
systemctl restart directadmin
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
BASHRC_FILE="/etc/bashrc"
|
||||||
|
ROOT_BASHRC_FILE="/root/.bashrc"
|
||||||
|
PROFILE_FILE="/etc/profile"
|
||||||
|
ROOT_BASH_PROFILE="/root/.bash_profile"
|
||||||
|
|
||||||
|
read -r -d '' PROMPT_BLOCK << 'EOF'
|
||||||
|
if [ -n "$STY" ]; then
|
||||||
|
screen_info="\[\e[0;1;33m\](screen $(echo "$STY" | cut -d. -f2)) \[\e[0m\]"
|
||||||
|
else
|
||||||
|
screen_info=""
|
||||||
|
fi
|
||||||
|
PS1="${screen_info}\[\e[0;1;38;5;46m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0;1;97m\]\W\[\e[0m\]]\[\e[0;38;5;46m\]\$ \[\e[0m\]"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
read -r -d '' ROOT_PROMPT_BLOCK << 'EOF'
|
||||||
|
if [ -n "$STY" ]; then
|
||||||
|
screen_info="\[\e[0;1;33m\](screen $(echo "$STY" | cut -d. -f2)) \[\e[0m\]"
|
||||||
|
else
|
||||||
|
screen_info=""
|
||||||
|
fi
|
||||||
|
PS1="${screen_info}\[\e[0;1;91m\]\u\[\e[0m\]@\[\e[0;1;38;5;214m\]\h\[\e[0m\][\[\e[0;1;97m\]\W\[\e[0m\]]\[\e[0;1;91m\]# \[\e[0m\]"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
append_prompt() {
|
||||||
|
local file="$1"
|
||||||
|
local block="$2"
|
||||||
|
echo "$block" | sudo tee -a "$file" > /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_last_PS1_line() {
|
||||||
|
local file="$1"
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
if tail -n 1 "$file" | grep -q '^PS1='; then
|
||||||
|
sudo sed -i '${/^PS1=/d;}' "$file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
append_prompt "$BASHRC_FILE" "$PROMPT_BLOCK"
|
||||||
|
append_prompt "$ROOT_BASHRC_FILE" "$ROOT_PROMPT_BLOCK"
|
||||||
|
remove_last_PS1_line "$PROFILE_FILE"
|
||||||
|
remove_last_PS1_line "$ROOT_BASH_PROFILE"
|
||||||
|
|
||||||
Reference in New Issue
Block a user