viewing paste Unknown #5422 | Diff

Posted on the
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: Makefile.in
--- Makefile.in Base (BASE)
+++ Makefile.in Locally Modified (Based On LOCAL)
@@ -2,13 +2,12 @@
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-       ALL_DEPENDS=common_sql login_sql char_sql map_sql tools import
-       SQL_DEPENDS=common_sql login_sql char_sql map_sql import
+       ALL_DEPENDS=sql tools
+       SQL_DEPENDS=common_sql login_sql char_sql map_sql import test
        COMMON_SQL_DEPENDS=mt19937ar libconfig
        LOGIN_SQL_DEPENDS=mt19937ar libconfig common_sql
        CHAR_SQL_DEPENDS=mt19937ar libconfig common_sql
        MAP_SQL_DEPENDS=mt19937ar libconfig common_sql
-       CONVERTERS_DEPENDS=common_sql
 else
        ALL_DEPENDS=needs_mysql
        SQL_DEPENDS=needs_mysql
@@ -20,7 +19,7 @@
 
 
 #####################################################################
-.PHONY: sql  \
+.PHONY: all sql  \
        common_sql \
        mt19937ar \
        login_sql \
@@ -29,7 +28,8 @@
        tools \
        import \
        test \
-       clean help
+       clean help \
+       install uninstall bin-clean \
 
 all: $(ALL_DEPENDS)
 
@@ -38,12 +38,6 @@
 common_sql: $(COMMON_SQL_DEPENDS)
        @$(MAKE) -C src/common sql
 
-mt19937ar:
-       @$(MAKE) -C 3rdparty/mt19937ar
-
-libconfig:
-       @$(MAKE) -C 3rdparty/libconfig
-
 login_sql: $(LOGIN_SQL_DEPENDS)
        @$(MAKE) -C src/login sql
 
@@ -53,6 +47,12 @@
 map_sql: $(MAP_SQL_DEPENDS)
        @$(MAKE) -C src/map sql
 
+mt19937ar:
+       @$(MAKE) -C 3rdparty/mt19937ar
+
+libconfig:
+       @$(MAKE) -C 3rdparty/libconfig
+
 tools:
        @$(MAKE) -C src/tool
 
@@ -94,46 +94,22 @@
        @echo "                'map_sql' and 'import')"
        @echo "'test'        - builds tests"
        @echo "'clean'       - cleans builds and objects"
+       @echo "'install'     - runs installer to set up rAthena in /opt/"
+       @echo "'bin-clean'   - deletes installed binary"
+       @echo "'uninstall'   - runs uninstaller to erase all installation changes"
        @echo "'help'        - outputs this message"
 
-#####################################################################
-
 needs_mysql:
        @echo "MySQL not found or disabled by the configure script"
        @exit 1
 
-#####################################################################
-# TODO
+install:      
+       @sh ./install.sh
 
-install:       conf/%.conf conf/%.txt
-       $(shell read -p "WARNING: This target does not work properly yet. Press Ctrl+C to cancel or Enter to continue.")
-       $(shell mkdir -p /opt/rathena/bin/)
-       $(shell mkdir -p /opt/rathena/etc/rathena/)
-       $(shell mkdir -p /opt/rathena/var/log/rathena/)
-       $(shell mv save /opt/rathena/etc/rathena/save)
-       $(shell mv db /opt/rathena/etc/rathena/db)
-       $(shell mv conf /opt/rathena/etc/rathena/conf)
-       $(shell mv npc /opt/rathena/etc/rathena/npc)
-       $(shell mv log/* /opt/rathena/var/log/rathena/)
-       $(shell cp *-server* /opt/rathena/bin/)
-       $(shell ln -s /opt/rathena/etc/rathena/save/ /opt/rathena/bin/)
-       $(shell ln -s /opt/rathena/etc/rathena/db/ /opt/rathena/bin/)
-       $(shell ln -s /opt/rathena/etc/rathena/conf/ /opt/rathena/bin/)
-       $(shell ln -s /opt/rathena/etc/rathena/npc/ /opt/rathena/bin/)
-       $(shell ln -s /opt/rathena/var/log/rathena/ /opt/rathena/bin/log)
-
 bin-clean:
-       $(shell rm /opt/rathena/bin/login-server*)
-       $(shell rm /opt/rathena/bin/char-server*)
-       $(shell rm /opt/rathena/bin/map-server*)
+       @sh ./uninstall.sh bin
 
 uninstall:
-       $(shell read -p "WARNING: This target does not work properly yet. Press Ctrl+C to cancel or Enter to continue.")
-       bin-clean
-       $(shell rm /opt/rathena/bin/save)
-       $(shell rm /opt/rathena/bin/db)
-       $(shell rm /opt/rathena/bin/conf)
-       $(shell rm /opt/rathena/bin/npc)
-       $(shell rm /opt/rathena/bin/log)
-       $(shell rm -rf /opt/rathena/etc/rathena)
-       $(shell rm -rf /opt/rathena/var/log/rathena)
+       @sh ./uninstall.sh all
+
+#####################################################################
Index: athena-start
--- athena-start Base (BASE)
+++ athena-start Locally Modified (Based On LOCAL)
@@ -1,64 +1,85 @@
 #!/bin/sh
-# athena starting script by rowla
-# modified by shazeya@syafi.com (NL101541)
 
-PATH=./:$PATH
+#source var/function
+. ./function.sh
+inst_launch_workaround
 
-L_SRV=login-server_sql
-C_SRV=char-server_sql
-M_SRV=map-server_sql
-
+PATH=./:$PATH
 print_start() {
 #    more << EOF
 echo "Athena Starting..."
-echo "            (c) 2003 Athena Project"
-echo "              modified by shazeya@syafi.com"
+  echo "            (c) 2013 rAthena Project"
 echo ""
-#echo "Debug informations will appear,"
-#echo "since this is a test release."
-#echo ""
+  echo ""
 echo "checking..."
 #EOF
 }
 
-check_files() {
-
-    for i in ${L_SRV} ${C_SRV} ${M_SRV}
-    do
-        if [ ! -f ./$i ]; then
-            echo "$i does not exist, or can't run."
-            echo "Stop. Check your compile."
-            exit 1;
+get_status(){
+   PIDFILE=.$1.pid
+   if [ -e ${PIDFILE} ]; then
+    ISRUN=$(ps ax | grep $(cat ${PIDFILE}) | grep $1)
+    PSRUN=$(echo "$ISRUN" | awk '{ print substr( $0, 0, 7) }')
         fi
-    done
+}
 
-#    more << EOF
-echo "Check complete."
-echo "Looks good, a nice Athena!"
-#EOF
+#Checking if already started, launch and mark in log
+start_serv(){
+  LOGFILE=./log/$1.log
+  get_status $1
+  if [ -z ${PSRUN} ]; then
+    exec ./$1&
+    echo $! > .$1.pid
+    echo "Server '$1' started at `date +"%m-%d-%H:%M-%S"`" >>  ${LOGFILE}
+  else echo "Can't start '$1' because it is already running p${PSRUN}" >> ${LOGFILE}
+  fi
 }
 
+watch_serv(){
+  LOGFILE=./log/$1.log
+  ulimit -Sc unlimited
 
+  while true; do
+   get_status $1
+   if [ -z ${PSRUN} ]; then
+     $count=$count+1
+     echo "Server '$1' is down." >> ${LOGFILE}
+     echo "Restarting server at time at `date +"%m-%d-%H:%M-%S"`">> ${LOGFILE}
+     exec ./$1&
+     echo $! > .$1.pid
+    
+     if [ $3 ] && [ $3 -lt $count ]; then break; fi
+   else sleep $2    
+   fi
+}
+
 case $1 in
     'start')
         print_start
         check_files
-
-        exec ./${L_SRV}&
-       echo $! > .${L_SRV}.pid
-        exec ./${C_SRV}&
-       echo $! > .${C_SRV}.pid
-        exec ./${M_SRV}&
-       echo $! > .${M_SRV}.pid
-
+       echo "Check complete."
+       echo "Looks good, a nice Athena!"
+       for i in ${L_SRV} ${C_SRV} ${M_SRV}
+           do
+               start_serv $i
+           done
         echo "Now Started Athena."
 ;;
+#experimental
+    'watch')
+       for i in ${L_SRV} ${C_SRV} ${M_SRV}
+           do         
+               watch_serv $i 10 3
+           done
+       echo "Now watching Athena."
+;;    
     'stop')
-       for i in .${L_SRV}.pid .${C_SRV}.pid .${M_SRV}.pid
+       for i in ${L_SRV} ${C_SRV} ${M_SRV}
            do
-               if [ -e ./$i ]; then
-                   kill $(cat $i)
-                   rm $i
+               PIDFILE=.${i}.pid
+               if [ -e ./${PIDFILE} ]; then
+                   kill $(cat ${PIDFILE})
+                   rm ${PIDFILE}
                fi
            done
 ;;
@@ -66,7 +87,16 @@
         $0 stop
         $0 start
 ;;
+    'status')
+       for i in ${L_SRV} ${C_SRV} ${M_SRV}
+       do
+               get_status ${i}
+               if [ ${PSRUN} ]; then echo "'${i}' is running p${PSRUN}"; else echo "${i} seems down"; fi
+       done
+;;    
     *)
-        echo "Usage: athena-start { start | stop | restart }"
+        echo "Usage: athena-start { start | stop | restart | status | watch }"
 ;;
 esac
+
+
Index: char-server.sh
--- char-server.sh Base (BASE)
+++ char-server.sh Locally Deleted
@@ -1,16 +0,0 @@
-#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 3 ] ; do
-if [ -f .stopserver3 ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./char-server_sql
-fi
-
-sleep 5
-
-done
Index: function.sh
--- function.sh No Base Revision
+++ function.sh Locally New
@@ -0,0 +1,26 @@
+L_SRV=login-server_sql
+C_SRV=char-server_sql
+M_SRV=map-server_sql
+INST_PATH=/opt
+PKG=rathena
+PKG_PATH=$INST_PATH/$PKG
+
+check_files() {
+    for i in ${L_SRV} ${C_SRV} ${M_SRV}
+    do
+        if [ ! -f ./$i ]; then
+            echo "$i does not exist, exiting..."
+            exit 1;
+        fi
+    done
+}
+
+check_inst_right(){
+    if [ ! -w $INST_PATH ]; then echo "You must have sudo right to use this install (writte/read permission in /opt/ )" && exit; fi
+}
+
+inst_launch_workaround(){
+  if [ -d $PKG_PATH ]; then
+    if [ $(pwd) != $PKG_PATH ]; then cd $PKG_PATH; fi
+  fi
+}
Index: install.sh
--- install.sh No Base Revision
+++ install.sh Locally New
@@ -0,0 +1,25 @@
+#!/bin/sh
+#source var/function
+. ./function.sh
+
+check_inst_right
+check_files
+read -p "WARNING: This target is experimental. Press Ctrl+C to cancel or Enter to continue." readEnterKey
+mkdir -p $PKG_PATH/bin/
+mkdir -p $PKG_PATH/etc/$PKG/
+mkdir -p $PKG_PATH/var/$PKG/
+
+#We copy all file into opt/ dir and treat dir like normal unix arborescence
+rsync -r --exclude .svn db/ $PKG_PATH/var/$PKG/db
+rsync -r --exclude .svn log/ $PKG_PATH/var/$PKG/log
+rsync -r --exclude .svn conf/ $PKG_PATH/etc/$PKG/conf
+rsync -r --exclude .svn npc/ $PKG_PATH/npc
+cp athena-start $PKG_PATH/    
+mv *-server* $PKG_PATH/bin/
+
+ln -fs $PKG_PATH/var/$PKG/db/ $PKG_PATH/db
+ln -fs $PKG_PATH/var/$PKG/log/ $PKG_PATH/log
+ln -fs $PKG_PATH/etc/$PKG/conf/ $PKG_PATH/conf
+ln -fs $PKG_PATH/athena-start /usr/bin/$PKG
+for f in $(ls $PKG_PATH/bin/) ; do ln -fs $PKG_PATH/bin/$f $PKG_PATH/$f; done
+echo "Installation complete. You can now control server with '$PKG start'."
Index: login-server.sh
--- login-server.sh Base (BASE)
+++ login-server.sh Locally Deleted
@@ -1,16 +0,0 @@
-#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 2 ] ; do
-if [ -f .stopserver2 ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./login-server_sql
-fi
-
-sleep 5
-
-done
Index: map-server.sh
--- map-server.sh Base (BASE)
+++ map-server.sh Locally Deleted
@@ -1,16 +0,0 @@
-#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 1 ] ; do
-if [ -f .stopserver ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./map-server_sql
-fi
-
-sleep 5
-
-done
Index: src/char/Makefile.in
--- src/char/Makefile.in Base (BASE)
+++ src/char/Makefile.in Locally Modified (Based On LOCAL)
@@ -21,35 +21,38 @@
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-       CHAR_SERVER_SQL_DEPENDS=obj_sql $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
+       SQL_DEPENDS=char-server_sql
 else
-       CHAR_SERVER_SQL_DEPENDS=needs_mysql
+       SQL_DEPENDS=needs_mysql
 endif
+ALL_DEPENDS=sql
 
 @SET_MAKE@
 
 #####################################################################
-.PHONY : all char-server_sql clean help
+.PHONY : all sql clean help
 
-all: char-server_sql
+all: $(ALL_DEPENDS)
 
-char-server_sql: $(CHAR_SERVER_SQL_DEPENDS)
-       @echo " LD      $@"
-       @@CC@ @LDFLAGS@ -o ../../char-server_sql@EXEEXT@ $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
+sql: $(SQL_DEPENDS)
 
 clean:
        @echo " CLEAN   char"
        @rm -rf *.o obj_sql ../../char-server_sql@EXEEXT@
 
 help:
-       @echo "possible targets are 'char-server_sql' 'all' 'clean' 'help'"
-       @echo "'char-server_sql'  - char server (SQL version)"
+       @echo "possible targets are 'sql' 'all' 'clean' 'help'"
+       @echo "'sql'              - char server (SQL version)"
        @echo "'all'              - builds all above targets"
        @echo "'clean'            - cleans builds and objects"
        @echo "'help'             - outputs this message"
 
 #####################################################################
 
+char-server_sql: obj_sql $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
+       @echo " LD      $@"
+       @@CC@ @LDFLAGS@ -o ../../char-server_sql@EXEEXT@ $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
+
 needs_mysql:
        @echo "MySQL not found or disabled by the configure script"
        @exit 1
Index: src/common/Makefile.in
--- src/common/Makefile.in Base (BASE)
+++ src/common/Makefile.in Locally Modified (Based On LOCAL)
@@ -24,11 +24,11 @@
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-       ALL_DEPENDS=sql
        SQL_DEPENDS=common common_sql
 else
        SQL_DEPENDS=needs_mysql
 endif
+ALL_DEPENDS=sql
 
 @SET_MAKE@
 
Index: src/login/Makefile.in
--- src/login/Makefile.in Base (BASE)
+++ src/login/Makefile.in Locally Modified (Based On LOCAL)
@@ -19,19 +19,20 @@
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-       LOGIN_SERVER_SQL_DEPENDS=obj_sql $(LOGIN_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a  $(MT19937AR_OBJ)
+       SQL_DEPENDS=login-server_sql
 else
-       LOGIN_SERVER_SQL_DEPENDS=needs_mysql
+       SQL_DEPENDS=needs_mysql
 endif
+ALL_DEPENDS= sql
 
 @SET_MAKE@
 
 #####################################################################
 .PHONY :all sql clean help
 
-all: sql
+all: $(ALL_DEPENDS)
 
-sql: obj_sql login-server_sql
+sql: $(SQL_DEPENDS)
 
 clean:
        @echo " CLEAN   login"
@@ -58,7 +59,7 @@
 
 #executables
 
-login-server_sql: $(LOGIN_SERVER_SQL_DEPENDS)
+login-server_sql: obj_sql $(LOGIN_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a  $(MT19937AR_OBJ)
        @echo " LD      $@"
        @@CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ $(LOGIN_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
           
Index: src/map/Makefile.in
--- src/map/Makefile.in Base (BASE)
+++ src/map/Makefile.in Locally Modified (Based On LOCAL)
@@ -31,13 +31,11 @@
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-       ALL_DEPENDS=txt sql
        SQL_DEPENDS=map-server_sql
 else
-       ALL_TARGET=txt
        SQL_DEPENDS=needs_mysql
 endif
-TXT_DEPENDS=map-server
+ALL_DEPENDS=sql
 
 HAVE_PCRE=@HAVE_PCRE@
 ifeq ($(HAVE_PCRE),yes)
@@ -49,12 +47,10 @@
 @SET_MAKE@
 
 #####################################################################
-.PHONY : all txt sql clean help
+.PHONY : all sql clean help
 
 all: $(ALL_DEPENDS)
 
-txt: $(TXT_DEPENDS)
-
 sql: $(SQL_DEPENDS)
 
 clean:
@@ -62,13 +58,8 @@
        @rm -rf *.o obj_txt obj_sql ../../map-server@EXEEXT@ ../../map-server_sql@EXEEXT@
 
 help:
-ifeq ($(HAVE_MYSQL),yes)
        @echo "possible targets are 'sql' 'txt' 'all' 'clean' 'help'"
        @echo "'sql'   - map server (SQL version)"
-else
-       @echo "possible targets are 'txt' 'all' 'clean' 'help'"
-endif
-       @echo "'txt'   - map server (TXT version)"
        @echo "'all'   - builds all above targets"
        @echo "'clean' - cleans builds and objects"
        @echo "'help'  - outputs this message"
Index: src/test/Makefile.in
--- src/test/Makefile.in Base (BASE)
+++ src/test/Makefile.in Locally Modified (Based On LOCAL)
@@ -19,10 +19,14 @@
 @SET_MAKE@
 
 #####################################################################
-.PHONY :all test_spinlock
+.PHONY :all test_spinlock clean
 
 all: test_spinlock
 
+test_spinlock: $(TEST_SPINLOCK_DEPENDS)
+       @echo " LD      $@"
+       @@CC@ @LDFLAGS@ -o ../../test_spinlock@EXEEXT@ $(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
+
 clean:
        @echo " CLEAN   test"
        @rm -rf *.o obj ../../test_spinlock@EXEEXT@
@@ -35,12 +39,6 @@
        @echo " MKDIR   obj"
        @-mkdir obj
       
-#executables
-
-test_spinlock: $(TEST_SPINLOCK_DEPENDS)
-       @echo " LD      $@"
-       @@CC@ @LDFLAGS@ -o ../../test_spinlock@EXEEXT@ $(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
-
 # login object files
 
 obj/%.o: %.c $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
Index: test.sh
--- test.sh No Base Revision
+++ test.sh Locally New
@@ -0,0 +1,39 @@
+#!/bin/sh
+L_SRV=login-server_sql
+C_SRV=char-server_sql
+M_SRV=map-server_sql
+INST_PATH=/opt
+PKG=rathena
+PKG_PATH=$INST_PATH/$PKG
+
+check_files() {
+    for i in ${L_SRV} ${C_SRV} ${M_SRV}
+    do
+        if [ ! -f ./$i ]; then
+            echo "$i does not exist, installation cannot proceed."
+            exit 1;
+        fi
+    done
+}
+
+if [ ! -w $INST_PATH ]; then echo "You must have sudo right to use this install (writte/read permission in $INST_PATH )" && exit; fi
+check_files
+read -p "WARNING: This target is experimental. Press Ctrl+C to cancel or Enter to continue." readEnterKey
+mkdir -p $PKG_PATH/bin/
+mkdir -p $PKG_PATH/etc/rathena/
+mkdir -p $PKG_PATH/var/rathena/
+
+#We copy all file into opt/ dir and treat dir like normal unix arborescence
+rsync -r --exclude .svn db/ $PKG_PATH/var/rathena/db
+rsync -r --exclude .svn log/ $PKG_PATH/var/rathena/log
+rsync -r --exclude .svn conf/ $PKG_PATH/etc/rathena/conf
+rsync -r --exclude .svn npc/ $PKG_PATH/npc
+cp athena-start $PKG_PATH/    
+mv *-server* $PKG_PATH/bin/
+
+ln -fs $PKG_PATH/var/rathena/db/ $PKG_PATH/db
+ln -fs $PKG_PATH/var/rathena/log/ $PKG_PATH/log
+ln -fs $PKG_PATH/etc/rathena/conf/ $PKG_PATH/conf
+ln -fs $PKG_PATH/athena-start /usr/bin/rathena
+for f in $(ls $PKG_PATH/bin/) ; do ln -fs $PKG_PATH/bin/$f $PKG_PATH/$f; done
+echo "Installation complete. You can now control server with 'rathena start'"
Index: uninstall.sh
--- uninstall.sh No Base Revision
+++ uninstall.sh Locally New
@@ -0,0 +1,23 @@
+#!/bin/sh
+#source var/function
+. ./function.sh
+echo "My pkg path is $PKG_PATH"
+
+check_inst_right
+read -p "WARNING: This target is experimental. Press Ctrl+C to cancel or Enter to continue." readEnterKey
+case $1 in
+       'bin')
+               echo "Starting binary cleanup..."
+               rm -rf $PKG_PATH/bin/*
+               echo "Binary file was deleted."
+       ;;
+       'all')
+               echo "Starting uninstallation..."
+               rm -rf $PKG_PATH
+               rm -rf /usr/bin/$PKG
+               echo "Uninstallation successful."
+       ;;
+       '*')
+               echo "Please enter a target usage './uninstall { all | bin }'" 
+esac
+
Viewed 240 times, submitted by unknown.