Update makeuser

Changes to the  move_to_current()
This commit is contained in:
deepend-tildeclub 2023-09-28 06:37:00 -06:00 committed by GitHub
parent 42339d3f4e
commit d9f7850498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -35,10 +35,22 @@ is_banned() {
} }
move_to_current() { move_to_current() {
grep -E "makeuser\s+$1\s+$2\s+\"$3\"" /var/signups >> /var/signups_current # Try to find the user in the signups file and append to signups_current
sed -i "/makeuser\s\+$1\s\+$2\s\+\"$(echo "$3" | sed -e 's/[]\/$*.^[]/\\&/g')\"/d" /var/signups 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 case $1 in
-h | --help) -h | --help)
usage; exit ;; usage; exit ;;