API bash authentication.
When using whmapi1 to set all account to the shared ipv6 adres. (cpanel assigns only the shared ipv4 adres tot the vhost) i use this bash script:
How do i use the api authentication from the command line ? Regards. Arjen
--
#!/bin/bash
#
/bin/ls -1 /var/cpanel/users | while read USER; do
/bin/echo "Now processing ${USER} ..."
/usr/sbin/whmapi1 --user=${USER} ipv6_enable_account range=SHARED
--
error:
metadata:
command: ipv6_enable_account
reason: "Permission denied: You do not have the required privileges to run "ipv6_enable_account"."
result: 0
version: 1
---
How do i use the api authentication from the command line ? Regards. Arjen
-
The --user parameter instructs the API tool to perform the action as the specified user. What you want instead is username, which instructs the API tool which user to act on. Example: /bin/ls -1 /var/cpanel/users | while read USER; do /bin/echo "Now processing ${USER} ..." /usr/sbin/whmapi1 ipv6_enable_account username=${USER} range=SHARED; done
0 -
Kenneth, thanks for your input. changed username to user and it's working: #!/bin/bash # /bin/ls -1 /var/cpanel/users | while read USER; do /bin/echo "Now processing ${USER} ..." /usr/sbin/whmapi1 ipv6_enable_account user=${USER} range=SHARED; done
0
Please sign in to leave a comment.
Comments
2 comments