| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #!/bin/bash
- # info: deleting user ip
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- user="$1"
- ip="$2"
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_FUNC/shared_func.sh
- source $V_FUNC/ip_func.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking arg number
- check_args '2' "$#" 'user ip'
- # Checking argument format
- format_validation 'user' 'ip'
- # Checking user
- is_user_valid
- # Checking user is active
- is_user_suspended
- # Checking user ip
- is_sys_ip_valid
- # Checking ownership
- is_sys_ip_owner
- # Checking webdomains on ip
- is_ip_key_empty '$U_WEB_DOMAINS'
- # Checking users on ip
- is_ip_key_empty '$U_SYS_USERS'
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Deleting owner
- update_sys_ip_value '$OWNER' ''
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Updating user conf
- decrease_user_value $user '$IP_OWNED'
- # Logging
- log_event 'system' "$V_EVENT"
- exit $OK
|