push
This commit is contained in:
1 parent
093e6a7c14
commit
1a2a5f0faf
24 files changed
+578
-537
No files matched your search
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Run as root on OPNsense" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source_pkg="${1:-}"
|
||||
if [ -z "$source_pkg" ]; then
|
||||
echo "usage: $0 </path/to/os-rustproxy.pkg|https://.../os-rustproxy.pkg>" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
tmp=""
|
||||
case "$source_pkg" in
|
||||
http://*|https://*)
|
||||
tmp="/tmp/os-rustproxy-install.pkg"
|
||||
fetch -o "$tmp" "$source_pkg"
|
||||
package="$tmp"
|
||||
;;
|
||||
*)
|
||||
package="$source_pkg"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -f "$package" ]; then
|
||||
echo "Package not found: $package" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg add -f "$package"
|
||||
|
||||
# New configd action files are loaded only after configd is restarted.
|
||||
service configd restart
|
||||
/usr/local/sbin/pluginctl -cq cache_flush >/dev/null 2>&1 || true
|
||||
/usr/local/sbin/configctl template reload OPNsense/RustProxy >/dev/null 2>&1 || true
|
||||
|
||||
if [ -n "$tmp" ]; then
|
||||
rm -f "$tmp"
|
||||
fi
|
||||
|
||||
echo "RustProxy package installed. Open Services -> RustProxy."
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Run as root on OPNsense" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REPO_URL="${1:-}"
|
||||
PUBLIC_KEY_FILE="${2:-}"
|
||||
|
||||
if [ -z "$REPO_URL" ] || [ -z "$PUBLIC_KEY_FILE" ]; then
|
||||
echo "usage: $0 https://packages.example.net/rustproxy/26.7/amd64 /path/to/rustproxy-repo.pub" >&2
|
||||
exit 64
|
||||
fi
|
||||
if [ ! -r "$PUBLIC_KEY_FILE" ]; then
|
||||
echo "Public key not readable: $PUBLIC_KEY_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
install -d -m 0755 /usr/local/etc/pkg/repos /usr/local/etc/pkg/keys
|
||||
install -m 0444 "$PUBLIC_KEY_FILE" /usr/local/etc/pkg/keys/rustproxy-repo.pub
|
||||
|
||||
cat > /usr/local/etc/pkg/repos/RustProxy.conf <<EOF_CONF
|
||||
RustProxy: {
|
||||
url: "$REPO_URL",
|
||||
enabled: yes,
|
||||
signature_type: "pubkey",
|
||||
pubkey: "/usr/local/etc/pkg/keys/rustproxy-repo.pub"
|
||||
}
|
||||
EOF_CONF
|
||||
|
||||
pkg update -f -r RustProxy
|
||||
pkg install -y -r RustProxy os-rustproxy
|
||||
|
||||
echo "RustProxy plugin installed. Open Services -> RustProxy in OPNsense."
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
rm -f /usr/local/etc/pkg/repos/RustProxy.conf
|
||||
rm -f /usr/local/etc/pkg/keys/rustproxy-repo.pub
|
||||
pkg update -f
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Run as root on OPNsense" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/usr/local/sbin/configctl rustproxy stop >/dev/null 2>&1 || true
|
||||
pkg delete -y os-rustproxy || true
|
||||
service configd restart
|
||||
/usr/local/sbin/pluginctl -cq cache_flush >/dev/null 2>&1 || true
|
||||
|
||||
echo "RustProxy package removed."
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
pkg update -f -r RustProxy
|
||||
pkg install -y -r RustProxy os-rustproxy
|
||||
Reference in new issue
Block a user