forked from FriendSoftwareLabs/friendchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateAll.sh
executable file
·54 lines (45 loc) · 1.04 KB
/
updateAll.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
FRIEND=""
if [ -f "fup.path" ]; then
FRIEND=`cat fup.path`
echo "found fup.path: $FRIEND"
fi
if [ -z "$FRIEND" ]; then
FRIEND="/home/$USER/friendup"
fi
echo "FRIEND: $FRIEND"
FRIEND_CHECK=$FRIEND
# Eventually asks for the good directory
if [ ! -f "$FRIEND_CHECK/cfg/cfg.ini" ]; then
while true; do
temp=$(dialog --backtitle "Friend Chat update" --inputbox "\
Please enter the path to the FriendUP directory." 11 60 "$FRIEND_CHECK" --output-fd 1)
if [ $? = "1" ]; then
#clear
echo "Update aborted."
exit 1
fi
if [ $temp != "" ]; then
FRIEND_CHECK="$temp"
fi
# Verifies the directory
if [ ! -f "$FRIEND_CHECK/cfg/cfg.ini" ]; then
dialog --backtitle "Friend Chat client update" --msgbox "\
Friend was not found in this directory,\n\
or Friend was not properly installed." 10 50
else
#clear
break;
fi
done
fi
if [ "$FRIEND" != "$FRIEND_CHECK" ]; then
echo "new path found: $FRIEND_CHECK"
echo "$FRIEND_CHECK" > fup.path
FRIEND="$FRIEND_CHECK"
fi
cd server/
. ./update.sh $1
cd ..
cd client/
. ./update.sh