-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bash
More file actions
68 lines (52 loc) · 1.99 KB
/
install.bash
File metadata and controls
68 lines (52 loc) · 1.99 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
if [[ $(id -u) -ne 0 ]] ; then
echo "Please run as root";
exit 1;
fi
CWD=$(pwd);
chmod +x $CWD/cutebind;
#rm /usr/local/bin/cutebind 2> /dev/null;
ln -sf $CWD/cutebind /usr/local/bin/cutebind;
#rm /usr/bin/cutebind 2> /dev/null;
ln -sf $CWD/cutebind /usr/bin/cutebind;
#rm $HOME/Desktop/cutebind 2> /dev/null;
ln -sf $CWD/cutebind $HOME/Desktop/cutebind;
mkdir logs 2> /dev/null;
mkdir ipc 2> /dev/null;
if [ -f /etc/init.d/mysql* ]; then
echo '';
echo 'This script can initialize `cuteresolve` database schema and create a user account.';
echo 'Default user name and password are specified in cuteresolve.sql at the end of file.';
echo 'If you wish to change it, edit cuteresolve.sql and config.php before pressing "Y".';
echo 'If you already have `cuteresolve` database, the existing tables will not be touched,';
echo 'but password will be reset.';
read -n1 -r -p "Do you want to initialize database now? (Y/N) " key;
echo '';
fi;
if [ "$key" = 'y' ] || [ "$key" = 'Y' ]; then
echo '---------------------------------------------------------------------------------';
mysql -u root -p < cuteresolve.sql;
echo '---------------------------------------------------------------------------------';
else
echo '';
echo 'To initialize database at a later time execute:';
echo '$ mysql [-h <host>] -u root -p < cuteresolve.sql';
fi;
echo '';
echo 'Installed.';
echo '';
if [ ! -f ./config.my.php ]; then
echo 'We are still using default configuration file config.php. Please edit it now. Set all';
echo 'settings according to your environment and save as config.my.php';
fi;
read -n1 -r -p "Start cutebind now to see if it works? (Y/N) " key;
echo '';
if [ "$key" = 'y' ] || [ "$key" = 'Y' ]; then
echo 'Executing cutebind in console mode. Ctrl+C to exit ...
';
cutebind master;
else
echo '$ ./cutebind - deamon mode';
echo '$ ./cutebind master - console mode';
echo '$ ./cutebind help - for more help';
fi;