mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
Added web tab triggers. Issue #50
This commit is contained in:
parent
745318e14e
commit
3a09991f0a
8 changed files with 30 additions and 4 deletions
|
@ -692,6 +692,7 @@ update_user_value() {
|
|||
increase_user_value() {
|
||||
USER="$1"
|
||||
key="${2//$}"
|
||||
factor="${3-1}"
|
||||
|
||||
# Parsing current value
|
||||
conf="$V_USERS/$USER/user.conf"
|
||||
|
@ -701,7 +702,7 @@ increase_user_value() {
|
|||
fi
|
||||
|
||||
# Increasing
|
||||
new=$((old + 1 ))
|
||||
new=$((old + factor))
|
||||
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
||||
}
|
||||
|
||||
|
@ -731,6 +732,7 @@ is_type_valid() {
|
|||
decrease_user_value() {
|
||||
USER="$1"
|
||||
key="${2//$}"
|
||||
factor="${3-1}"
|
||||
|
||||
# Parsing current value
|
||||
conf="$V_USERS/$USER/user.conf"
|
||||
|
@ -743,7 +745,7 @@ decrease_user_value() {
|
|||
if [ "$old" -le 1 ]; then
|
||||
new=0
|
||||
else
|
||||
new=$((old - 1 ))
|
||||
new=$((old - factor))
|
||||
fi
|
||||
sed -i "s/$key='$old'/$key='$new'/g" $conf
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue