Answer the question
In order to leave comments, you need to log in
Need help setting up crontab?
You need to set up a one-time deletion of a user after a certain amount of time, part of the code:
Del_port_user(){
List_port_user
while true
do
echo -e "Введите порт пользователя для удаления"
read -e -p "(По умолчанию: отмена):" del_user_port
&& echo -e "Отмена..." && exit 1
del_user=$(cat "${config_user_mudb_file}"|grep '"port": '"${del_user_port}"',')
if ; then
port=${del_user_port}
match_del=$(python mujson_mgr.py -d -p "${del_user_port}"|grep -w "delete user ")
if ; then
echo -e "${Error} Удаление пользователя неуспешно ${Green_font_prefix}[Порт: ${del_user_port}]${Font_color_suffix} "
break
else
Del_iptables
Save_iptables
echo -e "${Info} Удаление пользователя успешно ${Green_font_prefix}[Порт: ${del_user_port}]${Font_color_suffix} "
echo
read -e -p "Хотите продолжить удаление пользователей?[Y/n]:" delyn
&& delyn="y"
if ; then
break
else
echo -e "${Info} Продолжение удаления конфигурации пользователя..."
Del_port_user
fi
fi
break
else
echo -e "${Error} Введите корректный порт !"
fi
done
}
Answer the question
In order to leave comments, you need to log in
how to make sure that the desired user with a specific port can be deleted after 14 days.
-e, --expiredate EXPIRE_DATE
The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD.
Here you can play with crowns. The crown you need will most likely take this form 0 0 14 * *
:. About launching the crown on ubunt here and here .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question