diff --git a/dapostinstall.sh b/dapostinstall.sh index 2f7688e..03d8015 100755 --- a/dapostinstall.sh +++ b/dapostinstall.sh @@ -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 diff --git a/imapsync.tar.gz b/imapsync.tar.gz index 120c1bd..d738ebf 100644 Binary files a/imapsync.tar.gz and b/imapsync.tar.gz differ diff --git a/user_modify_pre.sh b/user_modify_pre.sh new file mode 100644 index 0000000..afc338a --- /dev/null +++ b/user_modify_pre.sh @@ -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}:
" + echo "${response}" + exit 1 + fi + +fi