import directus db 4 pas possible de supprimer l'user debian sans être kick

This commit is contained in:
Valentin 2024-04-17 17:35:05 +02:00
parent 3d76ae8811
commit 7b664fe444
3 changed files with 3 additions and 7 deletions

View File

@ -6,7 +6,7 @@ Deployment [**D**ebian](https://www.debian.org/) (os) + [**C**addy](https://cadd
On a fresh install as root user using On a fresh install as root user using
`sudo pawwd root` `sudo passwd root`
`su - root` `su - root`

View File

@ -16,7 +16,7 @@ install_pkg() {
get_username() { get_username() {
if [[ -z "$username" ]]; then if [[ -z "$username" ]]; then
username=$(getent passwd 1000 | cut -d: -f1) username=$(getent passwd 1001 | cut -d: -f1)
fi fi
} }
@ -48,10 +48,6 @@ systemctl disable --now apache2
echo -e "${PURPLE}${BOLD}Create a user ? (y/N) ${RESET}" echo -e "${PURPLE}${BOLD}Create a user ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
if id "debian" &>/dev/null; then
sudo deluser --remove-home "debian"
fi
echo -e "${PURPLE}${BOLD}Create user${RESET}" echo -e "${PURPLE}${BOLD}Create user${RESET}"
read -p "Enter username: " username read -p "Enter username: " username

View File

@ -13,7 +13,7 @@ RESET='\033[0m'
echo -e "${PURPLE}${BOLD}Export Directus Database and files ? (y/N) ${RESET}" echo -e "${PURPLE}${BOLD}Export Directus Database and files ? (y/N) ${RESET}"
read answer read answer
if [[ "$answer" == "y" ]]; then if [[ "$answer" == "y" ]]; then
user=$(getent passwd 1000 | awk -F: '{print $1}') user=$(getent passwd 1001 | awk -F: '{print $1}')
site_name=$(ls /var/www/repositories/ | grep -v '^cms') site_name=$(ls /var/www/repositories/ | grep -v '^cms')
db_password=$(cat /var/www/repositories/cms*/.env | grep DB_PASSWORD | sed "s/[^']*'\([^']*\)'.*/\1/") db_password=$(cat /var/www/repositories/cms*/.env | grep DB_PASSWORD | sed "s/[^']*'\([^']*\)'.*/\1/")