3 # Please note: This script was not provided by the authors of Regain, but
4 # by the maintainer of the PKGBUILD - Frank Poehler <fp29129@googlemail.com>.
5 # It is released under the same license as Regain.
6 # For questions, suggestions or bug reports regarding this script,
10 REGAIN_PATH
="/opt/regain-desktop"
11 USER_PATH
="/home/$USER/.local/share/regain-desktop"
13 install_in_userspace
() {
14 if ! test -e "$USER_PATH"; then
16 echo "Created user's Regain directory in '$USER_PATH'."
18 if ! test -d "$USER_PATH"; then
19 save_ext
=".saved_`date`"
20 mv "$USER_PATH" "$USER_PATH$save_ext" ||
exit 1
21 echo "Tried to create user's Regain directory in '$USER_PATH', but found something here that does not seem to belong to Regain Desktop Search."
22 echo "Moved that to '$USER_PATH$save_ext'".
24 echo "Now created user's Regain directory in '$USER_PATH'."
28 if ! test -e "$USER_PATH"/conf
; then
29 mkdir
-p "$USER_PATH"/conf
30 cp -R --preserve=mode
"$REGAIN_PATH"/conf
/default
"$USER_PATH"/conf
/
31 echo "Copied default configuration into user's Regain directory."
32 echo "For details about Regain configuration, see"
33 echo "http://regain.murfman.de/wiki/doku.php?id=config"
35 if ! test -d "$USER_PATH"/conf
; then
36 save_ext
=".saved_`date`"
37 mv "$USER_PATH"/conf
"$USER_PATH/conf$save_ext" ||
exit 1
38 echo "Tried to copy default configuration files into '$USER_PATH/conf', but found something here that does seem to not belong to Regain Desktop Search."
39 mkdir
"$USER_PATH"/conf ||
exit 1
40 cp -R --preserve=mode
"$REGAIN_PATH"/conf
/default
"$USER_PATH"/conf
/ ||
exit 1
41 echo "Moved that to '$USER_PATH/conf$save_ext'".
42 echo "Now copied default configuration files into '$USER_PATH'"
46 for i
in 'preparator' 'web' 'regain.jar'; do
47 if ! test -e "$USER_PATH/$i"; then
48 ln -s "$REGAIN_PATH/$i" "$USER_PATH"
49 echo "Sym-linked '$REGAIN_PATH/$i' to '$USER_PATH/$i'."
54 if [ `whoami` == "root" ] ; then
55 USER_PATH
="$REGAIN_PATH"
61 running
=`lsof "$USER_PATH"/regain.jar 2>/dev/null`
62 if test -z "$running"; then
63 echo "Starting Regain..."
64 java
-Djava.library.path
=/usr
/lib
/jni
-jar regain.jar
67 echo "Regain is already running."
69 echo " lsof ""$USER_PATH"/regain.jar
70 echo 'grab the PID and do'
72 echo 'To restart Regain, run this script again after you have killed the running instance of Regain as described above.'