wg-api icon indicating copy to clipboard operation
wg-api copied to clipboard

wg.sh do not create the saved.tmp file

Open mhramos85 opened this issue 4 years ago • 2 comments

wg.sh do not create the saved.tmp file

mhramos85 avatar Oct 19 '20 22:10 mhramos85

Check permissions of folders within repo to make sure it can write. I'll treat this as a bug.

alectrocute avatar Dec 17 '20 17:12 alectrocute

The same here. The problem is, generate_and_install_server_config_file() loops $SAVED_FILE content to generate $WG_TMP_CONF_FILE. But add_user() doesn't add newly added user to $SAVED_FILE. Thus, the $SAVED_FILE remains empty. As a result, this makes final /etc/wireguard/$_INTERFACE.conf file corrupted. This issue is the same with issue #10.

As a workaround, I've added a line in the add_user() to append the newly added user details to $SAVED_FILE. I will send this as a PR. But it should be a more powerful solution to generate /etc/wireguard/$_INTERFACE.conf from profiles instead of appending user info to the temp file.

eercanayar avatar Jan 23 '21 14:01 eercanayar