Skip to content

Commit 4e7b27b

Browse files
authored
remove PHP code, and fix installer warning
When install hestia, Installer first add user and then install PHP, so this php code return a warning /usr/local/hestia/bin/v-add-user: line 36: php: command not found So why add php code to pure bash script :/
1 parent 69cee00 commit 4e7b27b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bin/v-add-user

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ source_conf "$HESTIA/conf/hestia.conf"
3535
is_user_free() {
3636
# these names may cause issues with MariaDB/MySQL database names and should be reserved:
3737
# sudo has been added due to Privilege escalation as sudo group has always sudo permission
38-
check_sysuser=$(php -r '$reserved_names=array("aria", "aria_log", "mysql", "mysql_upgrade", "ib", "ib_buffer",
39-
"ddl", "ddl_recovery", "performance", "sudo"); if(in_array(strtolower($argv[1]), $reserved_names, true)){echo implode(", ", $reserved_names);}' "$user")
40-
if [ -n "$check_sysuser" ]; then
41-
check_result "$E_INVALID" "The user name '$user' is reserved and cannot be used. List of reserved names: $check_sysuser"
42-
return
38+
reserved_names=("aria" "aria_log" "mysql" "mysql_upgrade" "ib" "ib_buffer" "ddl" "ddl_recovery" "performance" "sudo")
39+
if [[ "${reserved_names[@],,}" =~ "${user,,}" ]]; then
40+
check_result "$E_INVALID" "The user name '$user' is reserved and cannot be used. List of reserved names: ${reserved_names[*]}"
41+
return
4342
fi
4443
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep "^$user$")
4544
if [ -n "$check_sysuser" ] || [ -e "$USER_DATA" ]; then

0 commit comments

Comments
 (0)