Ark-Survival-Ascended-Server icon indicating copy to clipboard operation
Ark-Survival-Ascended-Server copied to clipboard

POK-manager.sh emtpies itself

Open chronic414z opened this issue 6 months ago • 0 comments

I run my ARK servers on a PC in my local network but my public IP is changing every day and my internet connection is dropped for a few minutes when it gets renewed. To restart the ARK servers after this I wrote a script which checks every 5 minutes the status of POK-manager.sh -status. When it find the line "Server not found under the current IP" it will stop the ARK instance and then start it again. The issue is, that the file POK-manager.sh is empty (0Bytes) after this.

My guess is that POK-manager.sh wants to update itself somewhere in the process. In the functions check_for_POK_updates() and update_manager_and_instances() you just check if wget or curl is available and if so it will run the command wget -q -O "$temp_file" "$script_url". But when you run this command without internet connection or against a wrong URL it will create an empty /tmp/POK-manager.sh file which later in the process will replace the real POK-manager.sh file.

Can you please add a check to replace the file only when for example the MD5 checksum is verified or if thats too much then maybe a check if the file has at least a certain size or grep something from the file to verify it is not empty?

chronic414z avatar Aug 21 '24 16:08 chronic414z