summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-04-13 12:42:34 +0200
committerErich Eckner <git@eckner.net>2016-04-13 12:42:34 +0200
commitc78af27f50e3f3072549a98433bf802dc08bcb5c (patch)
treed4a6b8ef3ad27a30a3382ae55ef38b4b270baef0 /README
downloadarchMirrorBootStrap-c78af27f50e3f3072549a98433bf802dc08bcb5c.tar.xz
initaler Commit
Diffstat (limited to 'README')
-rwxr-xr-xREADME49
1 files changed, 49 insertions, 0 deletions
diff --git a/README b/README
new file mode 100755
index 0000000..75341c4
--- /dev/null
+++ b/README
@@ -0,0 +1,49 @@
+#!/bin/bash
+# to be run as root ...
+
+set -o
+
+# import keys:
+pacman-key --add <(curl -o - "https://arch.eckner.net/archlinuxewe/masterkeys.gpg")
+
+# locally sign package-key
+pacman-key --lsign-key 0x43BF68D3
+
+# locally sign repository-key
+pacman-key --lsign-key 0x20194BA1
+
+# setup mirror in mirrorlist
+if ! grep -q "^Server = https://arch\.eckner\.net" /etc/pacman.d/mirrorlist
+then
+ ml="$(
+ curl -o - "https://arch.eckner.net/archlinuxewe/os/any/" 2> /dev/null | \
+ tr "<>" "\n\n" | \
+ grep "^pacman-mirrorlist-.*\.pkg\.tar\.xz\$" | \
+ tail -n1
+ )"
+ curl -o - "https://arch.eckner.net/archlinuxewe/os/any/${ml}" 2> /dev/null | \
+ tar -OxJ etc/pacman.d/mirrorlist > \
+ /etc/pacman.d/mirrorlist
+fi
+
+# setup repo in pacman.conf
+if grep -q "^\[archlinuxewe\]\$" /etc/pacman.conf
+then
+ tmpFile=$(mktemp)
+ cat /etc/pacman.conf | \
+ (
+ while read s
+ do
+ if [[ "$s" = "# The testing repositories"* ]]
+ then
+ echo '[archlinuxewe]'
+ echo 'SigLevel = Required'
+ echo 'Include = /etc/pacman.d/mirrorlist'
+ echo ''
+ fi
+ echo "${s}"
+ done
+ ) > "${tmpFile}"
+ cat "${tmpFile}" > /etc/pacman.conf
+ rm "${tmpFile}"
+fi