Merge changes from upstream

I'm a little angry
This commit is contained in:
ZonD Eighty 2012-12-28 23:31:02 +04:00
commit 2b16d9bd83
254 changed files with 24485 additions and 24094 deletions

View file

@ -1,54 +1,54 @@
#!/bin/bash
# info: change user shell
# options: user shell
#
# The function changes system shell of a user. Shell gives abilty to use ssh.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
shell=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'user shell'
validate_format 'user' 'shell'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Get shell full path
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$shell" |head -n1)
# Changing passwd file
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
shell=$(basename $shell_path)
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Changing user shell
update_user_value "$user" '$SHELL' "$shell"
# Logging
log_history "changed $user shell to $shell" '' 'admin'
log_event "$OK" "$EVENT"
exit
#!/bin/bash
# info: change user shell
# options: USER SHELL
#
# The function changes system shell of a user. Shell gives abilty to use ssh.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
shell=$2
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER SHELL'
validate_format 'user' 'shell'
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Get shell full path
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$shell" |head -n1)
# Changing passwd file
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
shell=$(basename $shell_path)
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Changing user shell
update_user_value "$user" '$SHELL' "$shell"
# Logging
log_history "changed $user shell to $shell" '' 'admin'
log_event "$OK" "$EVENT"
exit