File tree Expand file tree Collapse file tree
images/openwisp_wireguard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ mkdir -p $_APPLIED_CONF_DIR
2626assert_exit_code () {
2727 exit_code=$?
2828 lineno=$(( $1 - 1 ))
29+ if [ ! -z " $2 " ]; then
30+ echo $2
31+ fi
2932 if [ " $exit_code " != " 0" ]; then
3033 echo " Line $lineno : Command returned non zero exit code: $exit_code "
3134 exit $exit_code
@@ -34,7 +37,7 @@ assert_exit_code() {
3437
3538check_config () {
3639 _latest_checksum=$( $_CURL $_VPN_CHECKSUM_URL )
37- assert_exit_code $LINENO
40+ assert_exit_code $LINENO " Failed to fetch VPN checksum. Ensure VPN UUID and key are correct. "
3841 if [ -f " $_CHECKSUM_FILE " ]; then
3942 _current_checksum=$( cat $_CHECKSUM_FILE )
4043 else
@@ -66,7 +69,7 @@ update_config() {
6669 # for having public configurations
6770 umask 0117
6871 $( $_CURL $_VPN_DOWNLOAD_URL > " $_CONF_TAR " )
69- assert_exit_code $LINENO
72+ assert_exit_code $LINENO " Failed to download VPN configuration. Ensure VPN UUID and key are correct. "
7073 echo " Configuration downloaded, extracting it..."
7174 tar -zxvf $_CONF_TAR -C $CONF_DIR > /dev/null
7275 assert_exit_code $LINENO
You can’t perform that action at this time.
0 commit comments