function.sh 560 B

1234567891011121314151617181920212223242526
  1. L_SRV=login-server
  2. C_SRV=char-server
  3. M_SRV=map-server
  4. INST_PATH=/opt
  5. PKG=rathena
  6. PKG_PATH=$INST_PATH/$PKG
  7. check_files() {
  8. for i in ${L_SRV} ${C_SRV} ${M_SRV}
  9. do
  10. if [ ! -f ./$i ]; then
  11. echo "$i does not exist extiting"
  12. exit 1;
  13. fi
  14. done
  15. }
  16. check_inst_right(){
  17. if [ ! -w $INST_PATH ]; then echo "You must have sudo right to use this install (writte/read permission in /opt/ )" && exit; fi
  18. }
  19. inst_launch_workaround(){
  20. if [ -d $PKG_PATH ]; then
  21. if [ $(pwd) != $PKG_PATH ]; then cd $PKG_PATH; fi
  22. fi
  23. }