summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormax.bra2020-09-04 20:18:09 +0200
committermax.bra2020-09-04 20:18:09 +0200
commitad9b6cecb92e49dd98f417cc4c9c6fa420cb8b69 (patch)
treeb41b84ced65aaa090379748d05c2c49600469870
parente831adba1f3d22d6489f0c380b8808d48a671682 (diff)
downloadaur-ad9b6cecb92e49dd98f417cc4c9c6fa420cb8b69.tar.gz
webpage.sh config missing
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD5
-rw-r--r--mimic_basic-install.sh40
3 files changed, 48 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 45bddfc5a3df..2c8ea80da073 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -14,18 +14,20 @@ pkgbase = pi-hole-standalone
conflicts = pi-hole-server
backup = etc/dnsmasq.d/01-pihole.conf
source = pi-hole-standalone-core-5.1.2.tar.gz::https://github.com/pi-hole/pi-hole/archive/v5.1.2.tar.gz
- source = arch-server-core-5.1.2-045258886.patch::https://raw.githubusercontent.com/max72bra/pi-hole-standalone-archlinux-customization/master/arch-server-core-5.1.2.patch
+ source = arch-server-core-5.1.2-685262183.patch::https://raw.githubusercontent.com/max72bra/pi-hole-standalone-archlinux-customization/master/arch-server-core-5.1.2.patch
source = dnsmasq.include
source = pi-hole-gravity.service
source = pi-hole-gravity.timer
source = mimic_setupVars.conf.sh
+ source = mimic_basic-install.sh
source = piholeDebug.sh
md5sums = 53c2e69e58b5494dfc251aca1148fee2
- md5sums = 9bd88fe14800983bd67d9a3083885eed
+ md5sums = 2ff82b0be473adbe347e7469f0a9caa2
md5sums = 16cb5e4da1341fd971d6094ce2d44029
md5sums = 047f13d4ac97877f724f87b002aaee63
md5sums = d42a864f88299998f8233c0bc0dd093d
md5sums = 7821b6dfe380955073701e5acd1587a2
+ md5sums = c9a5fa5fe9b794b0630cb53fb343f598
md5sums = 6139cbc8cf38a7bb2a32f9e855eaf7d9
pkgname = pi-hole-standalone
diff --git a/PKGBUILD b/PKGBUILD
index 0b2490f555a2..2063d353f562 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,14 +20,16 @@ source=($pkgname-core-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/arc
$_pkgname-gravity.service
$_pkgname-gravity.timer
mimic_setupVars.conf.sh
+ mimic_basic-install.sh
piholeDebug.sh)
md5sums=('53c2e69e58b5494dfc251aca1148fee2'
- '9bd88fe14800983bd67d9a3083885eed'
+ '2ff82b0be473adbe347e7469f0a9caa2'
'16cb5e4da1341fd971d6094ce2d44029'
'047f13d4ac97877f724f87b002aaee63'
'd42a864f88299998f8233c0bc0dd093d'
'7821b6dfe380955073701e5acd1587a2'
+ 'c9a5fa5fe9b794b0630cb53fb343f598'
'6139cbc8cf38a7bb2a32f9e855eaf7d9')
prepare() {
@@ -55,6 +57,7 @@ package() {
install -Dm755 piholeDebug.sh "$pkgdir"/opt/pihole/piholeDebug.sh
install -Dm755 mimic_setupVars.conf.sh "$pkgdir"/opt/pihole/mimic_setupVars.conf.sh
+ install -Dm755 mimic_basic-install.sh "$pkgdir"/opt/pihole/basic-install.sh
cp -dpr --no-preserve=ownership $_pkgname-$pkgver/advanced/Scripts/database_migration "$pkgdir"/opt/pihole/
diff --git a/mimic_basic-install.sh b/mimic_basic-install.sh
new file mode 100644
index 000000000000..f1feac7abe3e
--- /dev/null
+++ b/mimic_basic-install.sh
@@ -0,0 +1,40 @@
+source "/etc/pihole/setupVars.conf"
+PI_HOLE_BIN_DIR="/usr/bin"
+
+# from official basic-install.sh
+valid_ip() {
+ # Local, named variables
+ local ip=${1}
+ local stat=1
+
+ # One IPv4 element is 8bit: 0 - 256
+ local ipv4elem="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";
+ # optional port number starting '#' with range of 1-65536
+ local portelem="(#([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-6]))?"
+ # build a full regex string from the above parts
+ local regex="^${ipv4elem}\.${ipv4elem}\.${ipv4elem}\.${ipv4elem}${portelem}$"
+
+ [[ $ip =~ ${regex} ]]
+
+ stat=$?
+ # Return the exit code
+ return "${stat}"
+}
+
+valid_ip6() {
+ local ip=${1}
+ local stat=1
+
+ # One IPv6 element is 16bit: 0000 - FFFF
+ local ipv6elem="[0-9a-fA-F]{1,4}"
+ # CIDR for IPv6 is 1- 128 bit
+ local v6cidr="(\\/([1-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])){0,1}"
+ # build a full regex string from the above parts
+ local regex="^(((${ipv6elem}))((:${ipv6elem}))*::((${ipv6elem}))*((:${ipv6elem}))*|((${ipv6elem}))((:${ipv6elem})){7})${v6cidr}$"
+
+ [[ ${ip} =~ ${regex} ]]
+
+ stat=$?
+ # Return the exit code
+ return "${stat}"
+}