Skip to content

Commit a651436

Browse files
authored
Merge pull request #17 from theonemcdonald/devel
Refactored global variables and reorganized function includes
2 parents 5604a80 + 8b32680 commit a651436

File tree

15 files changed

+447
-299
lines changed

15 files changed

+447
-299
lines changed

extra/images/screen2.PNG

-7.56 KB
Loading

extra/images/screen3.PNG

692 Bytes
Loading

extra/images/screen6.PNG

49.4 KB
Loading

src/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# $FreeBSD$
22

33
PORTNAME= pfSense-pkg-WireGuard
4-
PORTVERSION= 0.0.4
5-
PORREVISION= 1
4+
PORTVERSION= 0.0.5
5+
PORREVISION= 0
66
CATEGORIES= net
77
MASTER_SITES= # empty
88
DISTFILES= # empty
@@ -56,10 +56,15 @@ do-install:
5656
${STAGEDIR}${PREFIX}/pkg/wireguard
5757
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/wireguard/wg_api.inc \
5858
${STAGEDIR}${PREFIX}/pkg/wireguard
59+
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/wireguard/wg_globals.inc \
60+
${STAGEDIR}${PREFIX}/pkg/wireguard
61+
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/wireguard/wg_install.inc \
62+
${STAGEDIR}${PREFIX}/pkg/wireguard
5963
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/wireguard/wg_extras.inc \
6064
${STAGEDIR}${PREFIX}/pkg/wireguard
6165
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/wireguard/wg_validate.inc \
6266
${STAGEDIR}${PREFIX}/pkg/wireguard
67+
6368
${INSTALL_DATA} -m 0755 ${FILESDIR}${PREFIX}/pkg/wireguard/etc/rc.bootstrap_wireguard \
6469
${STAGEDIR}${PREFIX}/pkg/wireguard/etc
6570

src/files/usr/local/etc/rc.reload_wireguard

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require_once('config.inc');
2727
// WireGuard includes
2828
require_once('/usr/local/pkg/wireguard/wg.inc');
2929

30-
// Nice to have someoutput when running manually after system startup for testing
30+
// Nice to have some output when running manually after system startup for testing
3131
$run_verbose = true;
3232

3333
if (platform_booting()) {
@@ -38,8 +38,7 @@ if (platform_booting()) {
3838

3939
}
4040

41-
// Destroy first to supersede any lo placeholder interfaces after startup
42-
wg_configure_from_confs($wgconfpath, true, $run_verbose);
41+
wg_configure($run_verbose);
4342

4443
if (platform_booting()) {
4544

src/files/usr/local/pkg/wireguard/etc/rc.bootstrap_wireguard

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
require_once('globals.inc');
2525
require_once('config.inc');
2626

27+
// This file absolutely cannot be dependent on the package! It must standalone and only depend on pfSense includes
28+
2729
// This is a hack to get text onto the console during booting from a php-cgi script
2830
function print_message($message) {
2931

3032
$message = gettext($message);
3133

32-
$message = escapeshellarg($message);
34+
$message = escapeshellarg($message);
3335

34-
// printf is a shell builtin
36+
// printf is a shell builtin
3537
exec("printf {$message} >&2");
3638

3739
}
@@ -57,9 +59,9 @@ foreach ($if_list as $realif => $name) {
5759

5860
if (substr($realif, 0, 2) == "wg") {
5961

60-
exec("/sbin/ifconfig {$ifname}" . $verbose_pipe . " || ifconfig lo create name {$ifname}");
62+
exec("(/sbin/ifconfig {$ifname} || /sbin/ifconfig lo create name {$ifname})" . $verbose_pipe);
6163

62-
exec("/sbin/ifconfig {$ifname} group wg");
64+
exec("/sbin/ifconfig {$ifname} group wg" . $verbose_pipe);
6365

6466
}
6567

0 commit comments

Comments
 (0)