Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Configure the server
- # server name
- while true; do
- read -p "ARK Server Name (no special characters): " ark_SessionName
- if ! [[ "$ark_SessionName" =~ [^(a-zA-Z0-9|[:blank])] ]]; then
- if [[ -z "${ark_SessionName// }" ]]; then
- echo "Cannot be empty"
- else
- break
- fi
- else
- echo 'Invalid input!'
- fi
- done
- # server password
- while true; do
- read -p "ARK Server Password (blank for none, no special characters): " ark_ServerPassword
- if ! [[ "$ark_ServerPassword" =~ [^a-zA-Z0-9] ]]; then
- break
- else
- echo 'Invalid input!'
- fi
- done
- # server admin password
- while true; do
- read -p "ARK Server Admin Password (no special characters): " ark_ServerAdminPassword
- if ! [[ "$ark_ServerAdminPassword" =~ [^a-zA-Z0-9] ]]; then
- if [[ -z "${ark_ServerAdminPassword// }" ]]; then
- echo "Cannot be empty"
- else
- break
- fi
- else
- echo 'Invalid input!'
- fi
- done
- file="/etc/arkmanager/arkmanager.cfg"
- tmp_file="/etc/arkmanager/_arkmanager.cfg"
- awk '{gsub("ark_SessionName=\"ARK Server Tools\"", "ark_SessionName=\"'"$ark_SessionName"'\""); print $0}' $file > $tmp_file && mv $tmp_file $file
- awk '{gsub("ark_ServerPassword=\"\"", "ark_ServerPassword=\"'"$ark_ServerPassword"'\""); print $0}' $file > $tmp_file && mv $tmp_file $file
- awk '{gsub("ark_ServerAdminPassword=\"keyboardcat\"", "ark_ServerAdminPassword=\"'"$ark_ServerAdminPassword"'\""); print $0}' $file > $tmp_file && mv $tmp_file $file
- awk '{gsub("ark_MaxPlayers=\"70\"", "ark_MaxPlayers=\"25\""); print $0}' $file > $tmp_file && mv $tmp_file $file
- echo "installation finished, please note the following important information"
- #echo "ssh port: $port"
- echo "ssh user: steam"
- echo "ssh user password: $password"
- echo "ark server name: $ark_SessionName"
- echo "ark server password: $ark_ServerPassword"
- echo "ark server admin password: $ark_ServerAdminPassword"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement