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
22 lines (16 loc) · 771 Bytes
/
Copy path1.3.1.sh
File metadata and controls
22 lines (16 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# 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 $(ls $HESTIA/data/ips/); 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 [ ! -z "$new_usr" ]; then
sed -i "s/U_SYS_USERS='$current_usr'/U_SYS_USERS='$new_usr'/g" $HESTIA/data/ips/$ip
fi
done