Last active
February 1, 2024 12:56
-
-
Save dbwodlf3/b42f9404d24d48255bc6ef240b99eec4 to your computer and use it in GitHub Desktop.
Revisions
-
dbwodlf3 revised this gist
Feb 1, 2024 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,6 @@ steam_76561198062034644 steam_76561198439931286 steam_76561198429830992 steam_76561199286595126 steam_76561198416324936 steam_76561195549540434 steam_76561199016564421 -
dbwodlf3 revised this gist
Jan 30, 2024 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,5 @@ steam_76561198842051495 steam_76561198062034644 steam_76561198439931286 steam_76561198429830992 steam_76561199286595126 steam_76561198416324936 -
dbwodlf3 revised this gist
Jan 30, 2024 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ steam_76561197998896427 steam_76561198300315915 steam_76561198842051495 steam_76561198062034644 steam_76561198439931286 steam_76561198429830992 steam_76561199286595126 -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ # 저장할 파일 경로 BASE_URL="/home/palworld-server/palworld-server-docker/palworld/Pal/Saved/SaveGames" BAN_LIST="$BASE_URL/banlist.txt" ADDITIONAL_BANLIST_FILE="$BASE_URL/banlist.add.txt" BEFORE_HASH_ADDITIONAL_BANLIST_FILE="$BASE_URL/banlist.add.hash.txt" # 임시 파일 경로 TEMP_FILE1="$BASE_URL/banlist.temp1.txt" TEMP_FILE2="$BASE_URL/banlist.temp2.txt" @@ -13,7 +13,7 @@ URL="https://gist.github.com/seogo11/324078be81d22d0d27a894f9cd2c8094/raw/banlis # IF Need to Init? if [ ! -f "$TEMP_FILE1" ]; then curl -f -o "$TEMP_FILE1" "$URL" fi # URL에서 데이터를 가져와 임시 파일에 저장 @@ -30,22 +30,22 @@ else # 새로운 banlist가 있고 기존의 것과 다르면 기존 리스트에 추가 cat "$TEMP_FILE2" > "$TEMP_FILE1" cat "$TEMP_FILE2" > "$BAN_LIST" cat "$ADDITIONAL_BANLIST_FILE" >> "$BAN_LIST" echo "banlist가 업데이트 되었습니다." fi # 추가 파일과 기존 파일의 해시를 계산 HASH_ADD=$(md5sum "$ADDITIONAL_BANLIST_FILE" | awk '{print $1}') HASH_BEFORE_ADD=$(cat "$BEFORE_HASH_ADDITIONAL_BANLIST_FILE") # 해시 비교 if [ "$HASH_ADD" = "$HASH_BEFORE_ADD" ]; then echo "새로운 ADD banlist가 기존과 동일합니다. 업데이트가 필요 없습니다." else # 새로운 banlist가 있고 기존의 것과 다르면 기존 리스트에 추가 cat "$TEMP_FILE2" > "$TEMP_FILE1" cat "$TEMP_FILE2" > "$BAN_LIST" cat "$ADDITIONAL_BANLIST_FILE" >> "$BAN_LIST" echo "$HASH_ADD" > "$BEFORE_HASH_ADDITIONAL_BANLIST_FILE" echo "banlist가 업데이트 되었습니다." fi -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 22 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ #!/bin/bash # 저장할 파일 경로 BASE_URL="/home/palworld-server/palworld-server-docker/palworld/Pal/Saved/SaveGames" BAN_LIST="$BASE_URL/banlist.txt" ADDTIONAL_BANLIST_FILE="$BASE_URL/banlist.add.txt" BEFORE_HASH_ADDTIONAL_BANLIST_FILE="$BASE_URL/banlist.add.hash.txt" # 임시 파일 경로 TEMP_FILE1="$BASE_URL/banlist.temp1.txt" TEMP_FILE2="$BASE_URL/banlist.temp2.txt" # 데이터를 가져올 URL URL="https://gist.github.com/seogo11/324078be81d22d0d27a894f9cd2c8094/raw/banlist.txt" # IF Need to Init? if [ ! -f "$TEMP_FILE1" ]; then @@ -30,6 +30,22 @@ else # 새로운 banlist가 있고 기존의 것과 다르면 기존 리스트에 추가 cat "$TEMP_FILE2" > "$TEMP_FILE1" cat "$TEMP_FILE2" > "$BAN_LIST" cat "$ADDTIONAL_BANLIST_FILE" >> "$BAN_LIST" echo "banlist가 업데이트 되었습니다." fi # 추가 파일과 기존 파일의 해시를 계산 HASH_ADD=$(md5sum "$ADDTIONAL_BANLIST_FILE" | awk '{print $1}') HASH_BEFORE_ADD=$(cat BEFORE_HASH_ADDTIONAL_BANLIST_FILE) # 해시 비교 if [ "$HASH_ADD" = "$HASH_BEFORE_ADD" ]; then echo "새로운 banlist가 기존과 동일합니다. 업데이트가 필요 없습니다." else # 새로운 banlist가 있고 기존의 것과 다르면 기존 리스트에 추가 cat "$TEMP_FILE2" > "$TEMP_FILE1" cat "$TEMP_FILE2" > "$BAN_LIST" cat "$ADDTIONAL_BANLIST_FILE" >> "$BAN_LIST" HASH_ADD > "$BEFORE_HASH_ADDTIONAL_BANLIST_FILE" echo "banlist가 업데이트 되었습니다." fi -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,4 @@ steam_76561197998896427 steam_76561198062034644 steam_76561198300315915 steam_76561198842051495 -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ ## 사용법 Linux 기반으로 작성되어 있습니다. ```bash curl -o https://gist.github.com/dbwodlf3/b42f9404d24d48255bc6ef240b99eec4/raw/update_banlist.sh chmod +x ./update_banlist.sh ``` 위의 명령어를 통해서, shell script 파일을 다운로드 받아주세요. 그 다음에 update_banlist.sh 파일안의 BASE_URL="/Pal/Saved/SaveGames" 값을 설정 해 주세요. (banlist 파일이 저장되는 절대경로) ```bash crontab -e */10 * * * * /home/some_user/server-guide/crontab/scripts/update_banlist.sh ``` crontab 명령어를 통해서, 10분마다 해당 shell script 가 실행되도록 설정할 수 있습니다. 수동적으로 추가로 밴을 할려면, 같은경로의 banlist.add.txt 에 추가해줘야합니다. -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ ## inbash ```bash curl -o https://gist.github.com/dbwodlf3/b42f9404d24d48255bc6ef240b99eec4/raw/update_banlist.sh sed -i "s|BASE_URL=\".*\"|BASE_URL=\"~/Pal/Saved/SaveGames\"|" update_banlist.sh chmod +x ./update_banlist.sh crontab -e */10 * * * * /home/some_user/server-guide/crontab/scripts/update_banlist.sh ``` -
dbwodlf3 revised this gist
Jan 29, 2024 . 2 changed files with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ ## inbash curl -o https://gist.github.com/dbwodlf3/b42f9404d24d48255bc6ef240b99eec4/raw/update_banlist.sh sed -i "s|BASE_URL=\".*\"|BASE_URL=\"~/Pal/Saved/SaveGames\"|" update_banlist.sh chmod +x ./update_banlist.sh crontab -e */10 * * * * /home/some_user/server-guide/crontab/scripts/update_banlist.sh This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,7 @@ #!/bin/bash # 저장할 파일 경로 BASE_URL="/Pal/Saved/SaveGames" BAN_LIST="$BASE_URL/banlist.txt" ADDTIONAL_BANLIST_FILE="banlist.add.txt" # 임시 파일 경로 -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ TEMP_FILE1="$BASE_URL/banlist.temp1.txt" TEMP_FILE2="$BASE_URL/banlist.temp2.txt" # 데이터를 가져올 URL URL="https://gist.github.com/dbwodlf3/b42f9404d24d48255bc6ef240b99eec4/raw/banlist.txt" # IF Need to Init? if [ ! -f "$TEMP_FILE1" ]; then -
dbwodlf3 revised this gist
Jan 29, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ steam_76561197998896427 steam_76561198062034644 -
dbwodlf3 created this gist
Jan 29, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ #!/bin/bash # 저장할 파일 경로 TARGET="" BASE_URL="${TARGET}/Pal/Saved/SaveGames" BAN_LIST="$BASE_URL/banlist.txt" ADDTIONAL_BANLIST_FILE="banlist.add.txt" # 임시 파일 경로 TEMP_FILE1="$BASE_URL/banlist.temp1.txt" TEMP_FILE2="$BASE_URL/banlist.temp2.txt" # 데이터를 가져올 URL URL="" # IF Need to Init? if [ ! -f "$TEMP_FILE1" ]; then curl -o "$TEMP_FILE1" "$URL" fi # URL에서 데이터를 가져와 임시 파일에 저장 curl -L -o "$TEMP_FILE2" "$URL" # 임시 파일과 기존 파일의 해시를 계산 HASH_TEMP=$(md5sum "$TEMP_FILE2" | awk '{print $1}') HASH_ORIG=$(md5sum "$TEMP_FILE1" | awk '{print $1}') # 해시 비교 if [ "$HASH_TEMP" = "$HASH_ORIG" ]; then echo "새로운 banlist가 기존과 동일합니다. 업데이트가 필요 없습니다." else # 새로운 banlist가 있고 기존의 것과 다르면 기존 리스트에 추가 cat "$TEMP_FILE2" > "$TEMP_FILE1" cat "$TEMP_FILE2" > "$BAN_LIST" cat "$BAN_LIST.add.txt" >> "$BAN_LIST" echo "banlist가 업데이트 되었습니다." fi