Procházet zdrojové kódy

references to cimsqwbot are now in variables

Paul Klumpp před 10 roky
rodič
revize
a256dcab83
1 změnil soubory, kde provedl 15 přidání a 10 odebrání
  1. 15 10
      install_cmp_qwbot.sh

+ 15 - 10
install_cmp_qwbot.sh

@@ -7,6 +7,11 @@ NEEDS="git qmake make g++"
 DIR_LIBQWCL="libqwclient"
 DIR_QWBOT="qwbot"
 
+BIN_QWBOT="cimsqwbot"
+CFG_QWBOT="cimsqwbot.cfg"
+
+STARTER="startcimsqwbot.sh"
+
 for p in $NEEDS; do
   TEST=$(which $p 2> /dev/null)
 
@@ -34,8 +39,8 @@ PATH_QWBOT=$(pwd)
 cd ../${DIR_LIBQWCL}/
 LIBPATH=$(pwd)
 
-CONFIGNAME="${PATH_QWBOT}/cimsqwbot.cfg"
-STARTSCRIPTNAME="${PATH_QWBOT}/startcimsqwbot.sh"
+CONFIGNAME="${PATH_QWBOT}/${CFG_QWBOT}"
+STARTSCRIPTNAME="${PATH_QWBOT}/$STARTER"
 
 if [ "$INSTALL" == "1" ]; then
 
@@ -52,8 +57,8 @@ if [ "$INSTALL" == "1" ]; then
 		qmake
 		make
 
-    if [ -f "./cimsqwbot" ]; then
-                LD_LIBRARY_PATH=$LIBPATH ./cimsqwbot &
+    if [ -f "./${BIN_QWBOT}" ]; then
+                LD_LIBRARY_PATH=$LIBPATH ./${BIN_QWBOT} &
   		PID=$!
   		echo PID $PID
 
@@ -61,18 +66,18 @@ if [ "$INSTALL" == "1" ]; then
 		  kill $PID
     else
       echo
-      echo "It seems there have been problems compiling this thing! The binary ./cimsqwbot is missing."
+      echo "It seems there have been problems compiling this thing! The binary ./${BIN_QWBOT} is missing."
       echo "This is awkward. Probably some dependency was missing or had a wrong version while compilation."
       echo "Better go have a chat to the devs at irc://quakenet.org/qwnet"
       echo
       exit
     fi
 
-	  # cfg file should have been created by the start of cimsqwbot.
+	  # cfg file should have been created by the first start of the qwbot.
 
 	fi
 
-	# now, lets check the starting script to be executable in cimsqwbot
+	# now, lets check the starting script. It should be executable.
 	if [ -f "$STARTSCRIPTNAME" ]; then
 		chmod u+x "$STARTSCRIPTNAME"
 	fi
@@ -92,7 +97,7 @@ if [ "$INSTALL" == "1" ]; then
 	echo "   https://gitlab.netdome.biz/community-messaging-project/qwbot/wikis/home"
 	echo
 	echo "3. Now, it's cool to run:"
-	echo "   cd "$PATH_QWBOT" && ./startcimsqwbot.sh"
+	echo "   cd "$PATH_QWBOT" && ./$STARTER"
 	echo
 	echo "Have fun."
 	echo
@@ -100,9 +105,9 @@ if [ "$INSTALL" == "1" ]; then
 else
 
 	echo
-	echo "It seems the directories 'cimsqwbot' and 'libqwclient' already exist."
+	echo "It seems the directories '$DIR_QWBOT' and '$DIR_LIBQWCL' already exist."
 	echo "So, we did nothing. If you want a fresh install, delete these directories, but"
-	echo "be sure to save your cimsqwbot.cfg - if you have a good one."
+	echo "be sure to save your $CFG_QWBOT - if you have a good one."
 	echo
 	echo "Did nothing."
 	echo