diff --git a/mc-install.sh b/mc-install.sh index 6dca8bd..7758be2 100755 --- a/mc-install.sh +++ b/mc-install.sh @@ -37,11 +37,12 @@ printf "Do you want to set up PlayerSync [Y/n]: \n" read ansPlayerSync if [[ "$ansPlayerSync" =~ ("y"|"Y") || -z $ansPlayerSync ]]; then - printf "What username you want to use? (leave blank for default) \n" + printf "What username you want to use? (leave blank for default):\n" read user_name - printf "What password you want to use? (leave blank for default)\n" + printf "What password you want to use? (leave blank for default):\n" read password + fi sleep 2 @@ -50,8 +51,8 @@ sleep 2 printf "\n+ Starting to upgrade base system\n\n" -apt update -apt upgrade -y +apt update >> +apt upgrade -y >> apt autoremove --purge -y @@ -81,7 +82,7 @@ mv *neoforge*.jar NeoForge.jar ### Installing server ### -java -Xms512M -Xmx2048M -jar NeoForge.jar --installServer +java -Xms512M -Xmx2048M -jar NeoForge.jar --installServer >> /dev/null ### RAM configuration ### @@ -136,14 +137,14 @@ mkdir /opt/minecraft/config while IFS= read -r line; do if [[ $(echo $line | jq -r '.env.server') == "required" ]]; then dw_mr=$(echo $line | jq -r '.downloads[0]') - wget -O mods/ $dw_mr + wget mods/ $dw_mr fi done < <(jq -c '.files[]' 'data/mr.index.json') while IFS= read -r line; do if [[ $(echo $line | jq -r '.env.server') == "required" ]]; then dw_cf=$(echo $line | jq -r '.downloads[0]') - wget -O mods/ $dw_cf + wget mods/ $dw_cf fi done < <(jq -c '.files[]' 'data/cf.index.json') @@ -173,8 +174,14 @@ if [[ "$ansPlayerSync" =~ ["y"|"Y"] || -z $ansPlayerSync ]]; then rndr=$((RANDOM % (32765-10000+1)+10000)) sed -i "s/1234567890/$rndr$rndr/g" config/playersync-common.toml #gens uniqe id - sed -i "s/KurevskeHesloMain/$password/g" config/playersync-common.toml - sed -i "s/mainUser/$user_name/g" config/playersync-common.toml + + if [[ $password -n ]]; then + sed -i "s/KurevskeHesloMain/$password/g" config/playersync-common.toml + fi + + if [[ $user_name -z ]]; then + sed -i "s/mainUser/$user_name/g" config/playersync-common.toml + fi fi