Zakomentowanie kluczy i kolorków skoro są defaultowo

This commit is contained in:
Marek Miklewicz
2023-11-18 11:25:40 +01:00
parent 6bb687acbf
commit f75654a1f0
3 changed files with 35 additions and 5 deletions
+5 -5
View File
@@ -136,7 +136,7 @@ echo "Ustawienie kluczy logowania do DirectAdmina i kluczy SSH hitme"
cd /opt
sh daupdate.sh klucze
sh daupdate keyput
# sh daupdate keyput
cd $DAPOSTINSTALL_DIR
echo "Instalacja Modsecurity i regułek malware experts"
@@ -569,11 +569,11 @@ echo 'imapsync=type=checkbox&string=IMAPsync migrations (plugin)&desc=Allow acce
echo 'imapsync=ON' >> /usr/local/directadmin/data/users/admin/user.conf
cp lang_pl.php $DADIR/plugins/imapsync/lang
echo "Dodanie kolorowego prompta hitme"
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
# echo "Dodanie kolorowego prompta hitme"
# 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
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 "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
systemctl restart directadmin
BIN
View File
Binary file not shown.
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
#file should be created as /usr/local/directadmin/scripts/custom/user_modify_pre.sh
#chown diradmin:diradmin /usr/local/directadmin/scripts/custom/user_modify_pre.sh
#chmod 700 /usr/local/directadmin/scripts/custom/user_modify_pre.sh
#Create a login key on destination (mail) server with CMD_MODIFY_USER permissions
da_host='mx1.hitme.net.pl'
da_user='admin'
da_pass='R1g4W43e458H28ObOX1x747S61J57511lyDpfc7fRGXZfo1IX0UrhPP1tZ3apx29'
if [ "${action}" = "package" ]; then
json_data=$(cat <<- EOF
{
"user":"${user}",
"package":"${package}",
"json":"yes",
"action":"package"
}
EOF
)
response=$(curl -s --request "POST" --data "${json_data}" "https://${da_user}:${da_pass}@${da_host}:2222/CMD_MODIFY_USER?json=yes")
if ! echo "${response}" | grep -q \"success\"; then
echo "Problem with a package on ${da_host}:</br>"
echo "${response}"
exit 1
fi
fi