From d9f7850498d20b1841c161051c53c1e19887e974 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub <58404188+deepend-tildeclub@users.noreply.github.com> Date: Thu, 28 Sep 2023 06:37:00 -0600 Subject: [PATCH] Update makeuser Changes to the move_to_current() --- makeuser | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/makeuser b/makeuser index 489ab48..66603e8 100755 --- a/makeuser +++ b/makeuser @@ -35,10 +35,22 @@ is_banned() { } move_to_current() { - grep -E "makeuser\s+$1\s+$2\s+\"$3\"" /var/signups >> /var/signups_current - sed -i "/makeuser\s\+$1\s\+$2\s\+\"$(echo "$3" | sed -e 's/[]\/$*.^[]/\\&/g')\"/d" /var/signups + # Try to find the user in the signups file and append to signups_current + if grep -E "makeuser\s+$1\s+$2\s+\"$3\"" /var/signups >> /var/signups_current; then + echo "User moved to signups_current." + else + echo "User not found in signups." + fi + + # Try to remove the user from the signups file + if sed -i "/makeuser\s\+$1\s\+$2\s\+\"$(echo "$3" | sed -e 's/[]\/$*.^[]/\\&/g')\"/d" /var/signups; then + echo "User removed from signups." + else + echo "Failed to remove user from signups." + fi } + case $1 in -h | --help) usage; exit ;;