Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Vesta Web Interface
  • Search

API Suspened Users

Questions regarding the Web Interface
GUI
Post Reply
  • Print view
Advanced search
14 posts
  • 1
  • 2
  • Next
elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

API Suspened Users
  • Quote

Post by elicast » Sun Sep 27, 2015 3:23 pm

someone could tell me how to create a function to block multiple User by api vestacp
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Sun Sep 27, 2015 3:39 pm

elicast wrote:someone could tell me how to create a function to block multiple User by api vestacp

Create this with name 'v-suspend-mutli-user' and execute: v-suspend-mulit-user user1 user2 user3 ...

Code: Select all

#!/bin/bash
for user in "$@"
do
    echo "Suspend user $user"
    v-suspend-user $user
done
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Fri Oct 02, 2015 12:54 am

It is giving error

http://prntscr.com/8mqw2x

[root@VestaAdminTestes ~]# sudo /usr/local/vesta/bin/e-bloquear-revenda hdlio934hkds
sudo: unable to execute /usr/local/vesta/bin/e-bloquear-revenda: No such file or directory
[root@VestaAdminTestes ~]#
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Fri Oct 02, 2015 6:52 am

Run:

Code: Select all

ls -la /usr/local/vesta/bin/ | grep "e-bloquear-revenda"  
Check if the row starts with '-rwxr-xr-x'

If not? Run chmod +x /usr/local/vesta/bin/e-bloquear-revenda
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Fri Oct 02, 2015 10:42 am

thank you for your cooperation, but see the picture, everything is correct, but does not work

see: http://prntscr.com/8muomt
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Fri Oct 02, 2015 10:51 am

try:
sudo bash /usr/local/vesta/bin/e-bloquear-revenda
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Fri Oct 02, 2015 10:53 am

[root@VestaAdminTestes ~]# sudo bash /usr/local/vesta/bin/e-bloquear-revenda
'usr/local/vesta/bin/e-bloquear-revenda: line 3: syntax error near unexpected token `do
'usr/local/vesta/bin/e-bloquear-revenda: line 3: `do
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Fri Oct 02, 2015 12:24 pm

Code: Select all

sudo bash /usr/local/vesta/bin/e-bloquear-revenda username1 username2 username3
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Fri Oct 02, 2015 12:43 pm

see img: http://prntscr.com/8mvqyf

can not take User
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Fri Oct 02, 2015 1:45 pm

I do this and it works:

Code: Select all

[root@server5 ~]# v-list-users
USER         PACKAGE    U_DISK     U_BANDWIDTH  SUSPENDED  DATE
---------    ---------  ---------  ---------    ---------  ---------
admin
aardasp
torelay
[root@server5 ~]# cat test.sh
#!/bin/bash
for user in "$@"
do
    echo "Suspend user $user"
    #v-suspend-user $user #uncomment this line
done
[root@server5 ~]# bash test.sh admin aardasp torelay
Suspend user admin
Suspend user aardasp
Suspend user torelay
Top


Post Reply
  • Print view

14 posts
  • 1
  • 2
  • Next

Return to “Web Interface”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password