| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #!/bin/bash
- # info: updating system queue
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- pipe=$1
- # Importing system enviroment as we run this script
- # mostly by cron wich not read it by itself
- source /etc/profile.d/vesta.sh
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_CONF/vesta.conf
- source $V_FUNC/shared.func
- # Defining pipe functions
- restart_pipe() {
- for service in $(cat $V_QUEUE/restart.pipe |sort |uniq); do
- $V_BIN/v_restart_$service
- done
- echo > $V_QUEUE/restart.pipe
- }
- stats_pipe() {
- bash $V_QUEUE/stats.pipe
- }
- disk_pipe() {
- bash $V_QUEUE/disk.pipe
- }
- traff_pipe() {
- bash $V_QUEUE/traffic.pipe
- }
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking arg number
- check_args '1' "$#" 'pipe'
- # Checking argument format
- format_validation 'pipe'
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- case $pipe in
- restart) restart_pipe ;;
- stats) stats_pipe ;;
- backup) backup_pipe ;;
- disk) disk_pipe ;;
- traffic) traff_pipe ;;
- *) check_args '1' '0' 'pipe'
- esac
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event 'system' "$V_EVENT"
- exit
|