Skocz do zawartości

[Pytanie]Skrypt


Rekomendowane odpowiedzi

Co w tym skrypcie jest nie tak ? :

 

#!/bin/sh

echo -e "\033[33mCzy chcesz zainstalowac CH4?

1. Tak

2. Nie\033[0m"

 

read wybor

 

case $wybor in

2*)

echo -e "\033[36mJesli bd chcial zainstalowac 4Ch - uzyj panelu sterowania serwer, zawartego w katalogu z sf\033[0m"

sleep 4

exit

 

;;

 

1*)

echo -e "\033[34mInstalacja rozpoczyna się...\033[0m"

sleep 2

echo -e "\033[34mKopiowanie logow...\033[0m"

cd /usr/home/Polish_SF/

mkdir all_logs_CH2

mkdir all_logs_CH3

mkdir all_logs_CH4

cp -r logs all_logs_CH2

cp -r logs all_logs_CH3

cp -r logs all_logs_CH4

echo -e "\033[34mKopiowanie katalogów...\033[0m"

cd /usr/home/Polish_SF/

mkdir channel2

mkdir channel3

mkdir channel4

sleep 2

echo -e "\033[34mKopiowanie folderów...\033[0m"

cp -r game /usr/home/Polish_SF/channel2

cp -r game /usr/home/Polish_SF/channel3

cp -r game /usr/home/Polish_SF/channel4

cp -r game99 /usr/home/Polish_SF/channel2

cp -r game99 /usr/home/Polish_SF/channel3

cp -r game99 /usr/home/Polish_SF/channel4

cp -r game22 /usr/home/Polish_SF/channel2

cp -r game22 /usr/home/Polish_SF/channel3

cp -r game22 /usr/home/Polish_SF/channel4

sleep 2

echo -e "\033[34mCzyszczenie i tworzenie powiązań...\033[0m"

cd /usr/home/Polish_SF/channel2/game/

rm game

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game logs

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game/PTS PTS

cd /usr/home/Polish_SF/channel2/game99/

rm game99

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game99

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game99 logs

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game99/PTS PTS

cd /usr/home/Polish_SF/channel2/game22/

rm game22

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game22

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game22 logs

ln -s /usr/home/Polish_SF/all_logs_CH2/logs/game22/PTS PTS

cd /usr/home/Polish_SF/channel3/game/

rm game

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game logs

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game/PTS PTS

cd /usr/home/Polish_SF/channel3/game99/

rm game99

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game99

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game99 logs

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game99/PTS PTS

cd /usr/home/Polish_SF/channel3/game22/

rm game22

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game22

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game22 logs

ln -s /usr/home/Polish_SF/all_logs_CH3/logs/game22/PTS PTS

cd /usr/home/Polish_SF/channel4/game/

rm game

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game logs

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game/PTS PTS

cd /usr/home/Polish_SF/channel4/game99/

rm game99

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game99

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game99 logs

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game99/PTS PTS

cd /usr/home/Polish_SF/channel4/game22/

rm game22

rm CONFIG

rm PTS

rm -rf locale

rm -rf data

rm -rf logs

ln -s /usr/home/Polish_SF/share/locale locale

ln -s /usr/home/Polish_SF/share/data data

ln -s /usr/home/Polish_SF/share/game game22

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game22 logs

ln -s /usr/home/Polish_SF/all_logs_CH4/logs/game22/PTS PTS

sleep 2

echo -e "\033[34mEdytowanie CONFIGÓW...\033[0m"

cd /usr/home/Polish_SF/channel2/game/

echo 'HOSTNAME: channel1_CH2

CHANNEL: 2

PORT: 16000

P2P_PORT: 17000

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 1 2 3 4 5 6 7 8 9 10 11 21 23 24 25 41 43 44 45 61 62 63 64 65 66 69 70 71 72 73 104 108 109 67 68 80 74 75 76 77 78 79 100 101 103 105 107 110 111 112 180 190 191 192 193 194 206

#MAP_ALLOW: 113 184 185 186 187 188 189 193 179

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

adminpage_ip0: localhost

admin_page_password: loldeinemasucktaberderbe1236

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel2/game99/

echo 'HOSTNAME: channel99_CH2

CHANNEL: 2

PORT: 16001

P2P_PORT: 17001

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 12 113 184 185 186 187 188 189 81 181 182 183 114 118 119 120 121 122 123 124 125 126 127 128

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel2/game22/

echo 'HOSTNAME: channel22_CH2

CHANNEL: 2

PORT: 16022

P2P_PORT: 17022

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 184 185 186 187 188 189 193 179 112 113

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1

adminpage_ip1: localhost

adminpage_ip2: localhost

adminpage_ip3: localhost' >> CONFIG

cd /usr/home/Polish_SF/channel3/game/

echo 'HOSTNAME: channel1_CH3

CHANNEL: 3

PORT: 18000

P2P_PORT: 19000

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 1 2 3 4 5 6 7 8 9 10 11 21 23 24 25 41 43 44 45 61 62 63 64 65 66 69 70 71 72 73 104 108 109 67 68 80 74 75 76 77 78 79 100 101 103 105 107 110 111 112 180 190 191 192 193 194 206

#MAP_ALLOW: 113 184 185 186 187 188 189 193 179

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

adminpage_ip0: localhost

admin_page_password: loldeinemasucktaberderbe1236

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel3/game99/

echo 'HOSTNAME: channe99_CH3

CHANNEL: 3

PORT: 18001

P2P_PORT: 19001

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 12 113 184 185 186 187 188 189 81 181 182 183 114 118 119 120 121 122 123 124 125 126 127 128

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel3/game22/

echo 'HOSTNAME: channel22_CH3

CHANNEL: 2

PORT: 18022

P2P_PORT: 19022

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 184 185 186 187 188 189 193 179 112 113

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2 !@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1

adminpage_ip1: localhost

adminpage_ip2: localhost

adminpage_ip3: localhost' >> CONFIG

cd /usr/home/Polish_SF/channel4/game/

echo 'HOSTNAME: channel1_CH4

CHANNEL: 4

PORT: 20000

P2P_PORT: 21000

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 1 2 3 4 5 6 7 8 9 10 11 21 23 24 25 41 43 44 45 61 62 63 64 65 66 69 70 71 72 73 104 108 109 67 68 80 74 75 76 77 78 79 100 101 103 105 107 110 111 112 180 190 191 192 193 194 206

#MAP_ALLOW: 113 184 185 186 187 188 189 193 179

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

adminpage_ip0: localhost

admin_page_password: loldeinemasucktaberderbe1236

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel4/game99/

echo 'HOSTNAME: channel99_CH4

CHANNEL: 4

PORT: 20001

P2P_PORT: 21001

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 12 113 184 185 186 187 188 189 81 181 182 183 114 118 119 120 121 122 123 124 125 126 127 128

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1' >> CONFIG

cd /usr/home/Polish_SF/channel4/game22/

echo 'HOSTNAME: channel22_CH4

CHANNEL: 2

PORT: 20022

P2P_PORT: 21022

DB_PORT: 15000

DB_ADDR: localhost

MAP_ALLOW: 184 185 186 187 188 189 193 179 112 113

TABLE_POSTFIX:

PASSES_PER_SEC: 25

SAVE_EVENT_SECOND_CYCLE: 180

PING_EVENT_SECOND_CYCLE: 180

PLAYER_SQL: localhost mt3 mt2!@# playerxd

LOG_SQL: localhost mt3 mt2!@# logxd

COMMON_SQL: localhost mt3 mt2!@# commonxd

LOCALE_SERVICE: poland

#TEST_SERVER: 1

#NO_PK: 1

MALL_URL: mpcforum.pl

VIEW_RANGE: 20000

CHECK_MULTIHACK: 1

adminpage_ip1: localhost

adminpage_ip2: localhost

adminpage_ip3: localhost' >> CONFIG

echo -e "\033[34mEdytowanie pliku start.sh...\033[0m"

cd /usr/home/Polish_SF/

rm start.sh

echo '#!/bin/sh

 

 

echo -e "\033[31m

Ile Ch chcesz odpalic? \n

1 - Jedno Ch

2 - Dwa CH

3 - Trzy CH

4 - Cztery CH\033[0m"

 

read chs

 

case $chs in

1*)

 

echo -e "\033[31m Startuje DB\033[0m"

cd /usr/home/Polish_SF/db/

./db &

sleep 2

clear

echo -e "\033[31m \n Startuje auth\033[0m"

cd /usr/home/Polish_SF/auth/

./auth &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game99/

./game99 &

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game22/

./game22 &

sleep 2

 

 

 

;;

2*)

 

echo -e "\033[31m Startuje DB\033[0m"

cd /usr/home/Polish_SF/db/

./db &

sleep 2

clear

echo -e "\033[31m \n Startuje auth\033[0m"

cd /usr/home/Polish_SF/auth/

./auth &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game22/

./game22 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game22/

./game22 &

sleep 2

 

;;

3*)

 

echo -e "\033[31m Startuje DB\033[0m"

cd /usr/home/Polish_SF/db/

./db &

sleep 2

clear

echo -e "\033[31m \n Startuje auth\033[0m"

cd /usr/home/Polish_SF/auth/

./auth &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game22/

./game22 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game22/

./game22 &

sleep 2

echo -e "\033[31m \n Startuje 3 Ch\033[0m"

cd /usr/home/Polish_SF/channel3/game/

./game &

sleep 2

echo -e "\033[31m \n Startuje 3 Ch\033[0m"

cd /usr/home/Polish_SF/channel3/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 3 Ch\033[0m"

cd /usr/home/Polish_SF/channel3/game22/

./game22 &

sleep 2

;;

4*)

 

echo -e "\033[31m Startuje DB\033[0m"

cd /usr/home/Polish_SF/db/

./db &

sleep 2

clear

echo -e "\033[31m \n Startuje auth\033[0m"

cd /usr/home/Polish_SF/auth/

./auth &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 1 Ch\033[0m"

cd /usr/home/Polish_SF/game22/

./game22 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 2 Ch\033[0m"

cd /usr/home/Polish_SF/channel2/game22/

./game22 &

sleep 2

echo -e "\033[31m \n Startuje 3 Ch\033[0m"

cd /usr/home/Polish_SF/channel3/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 3 Ch\033[0m"

cd /usr/home/Polish_SF/channel3/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 4 Ch\033[0m"

cd /usr/home/Polish_SF/channel4/game/

./game &

sleep 2

clear

echo -e "\033[31m \n Startuje 4 Ch\033[0m"

cd /usr/home/Polish_SF/channel4/game99/

./game99 &

sleep 2

echo -e "\033[31m \n Startuje 4 Ch\033[0m"

cd /usr/home/Polish_SF/channel4/game22/

./game22 &

sleep 2

;;

 

esac' >> start.sh

chmod 777 start.sh

 

;;

 

esac

 

 

Bo wyskakuje błąd jak go odpalam :

 

Czy chcesz zainstalowac CH4?

1. Tak

2. Nie

: not found

1

: bad variable name

: not found

CH4.sh: 9: Syntax error: word unexpected (expecting ")")

xxxx#

Odnośnik do komentarza

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

  • Ostatnio przeglądający forum [Pytanie]Skrypt   0 użytkowników
    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...