replaced underscore with dash in api syscalls

This commit is contained in:
Serghey Rodin 2012-11-09 18:26:32 +02:00
commit b6b7eacadb
283 changed files with 438 additions and 412 deletions

67
bin/v-list-sys-shells Executable file
View file

@ -0,0 +1,67 @@
#!/bin/bash
# info: list system shells
# options: [format]
#
# The function for obtaining the list of system shells.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
format=${1-shell}
# Includes
source $VESTA/func/main.sh
# Json function
json_list_sh() {
shells=$(cat /etc/shells)
sh_counter=$(echo "$shells" | wc -l)
i=1
echo '['
for shell in $shells; do
shell=$(basename $shell)
if [ "$i" -lt "$sh_counter" ]; then
echo -e "\t\"$shell\","
else
echo -e "\t\"$shell\""
fi
(( ++i))
done
echo "]"
}
# Shell function
shell_list_sh() {
shells=$(cat /etc/shells)
if [ -z "$nohead" ]; then
echo "SHELLS"
echo "----------"
fi
for shell in $shells; do
shell=$(basename $shell)
echo "$shell"
done
}
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Listing domains
case $format in
json) json_list_sh ;;
plain) nohead=1; shell_list_sh ;;
shell) shell_list_sh ;;
*) check_args '1' '0' '[format]' ;;
esac
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
exit