mirror of
https://gitea.invidious.io/iv-org/documentation.git
synced 2024-08-15 00:53:34 +00:00
T.: Improved string escapes in our scripts
This commit is contained in:
parent
676a6800f7
commit
4adc95224b
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ systemctl start podman-invidious_register
|
|||
CONTINUE='y'
|
||||
while [ "$CONTINUE" = 'y' ]; do
|
||||
read -rp 'User ID: ' ID
|
||||
if [ "$(su postgres -c "psql invidious -c \"SELECT email FROM users WHERE email = '$ID';\"" | tail -n 2 | head -n 1)" != '(0 rows)' ]; then
|
||||
if [ "$(su postgres -c "psql invidious -c \"SELECT email FROM users WHERE email = '\"'$ID'\"';\"" | tail -n 2 | head -n 1)" != '(0 rows)' ]; then
|
||||
echo 'Error: User ID is already taken'
|
||||
continue
|
||||
fi
|
||||
|
|
|
@ -38,5 +38,5 @@ if [ "$(su postgres -c "psql invidious -c \"SELECT email FROM users WHERE email
|
|||
fi
|
||||
|
||||
HASH="$(mkpasswd --method=bcrypt-a -R 10)"
|
||||
su postgres -c "psql invidious -c \"UPDATE users SET password = '$HASH' WHERE email = '$ID';\""
|
||||
su postgres -c "psql invidious -c \"UPDATE users SET password = '\"'$HASH'\"' WHERE email = '\"'$ID'\"';\""
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue