forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.3.1.sh
More file actions
21 lines (16 loc) · 750 Bytes
/
1.3.1.sh
File metadata and controls
21 lines (16 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Hestia Control Panel upgrade script for target version 1.3.1
#######################################################################################
####### Place additional commands below. #######
#######################################################################################
# Remove duplicate values in U_SYS_USERS variable for ips
for ip in $($BIN/v-list-sys-ips plain | cut -f1); do
current_usr=$(grep "U_SYS_USERS=" $HESTIA/data/ips/$ip | cut -f 2 -d \')
new_usr=$(echo "$current_usr" \
| sed "s/,/\n/g" \
| sort -u \
| sed ':a;N;$!ba;s/\n/,/g')
if [ -n "$new_usr" ]; then
sed -i "s/U_SYS_USERS='$current_usr'/U_SYS_USERS='$new_usr'/g" $HESTIA/data/ips/$ip
fi
done