--- /dev/null
+all: ~/.local/distro-begin ~/.local/distro-end
+
+~/.local/distro-begin: distro-begin
+ distro-begin
+
+~/.local/distro-end: distro-end distro-pkgs pkgs
+ distro-end
# note, for exim daemon, you can turn on debug options by
# adding -d, etc to COMMONOPTIONS in
# /etc/default/exim4
- # exim -d -t <<'EOF'
- exim -i 'test@zroe.org, t2@zroe.org' <<'EOF'
-From: ian@iankelling.org
-To: test@zroe.org, t2@zroe.org
-Subject: Testing Exim
+ #
+ # to specify recipients other than those in to, cc, bcc, you can use the cli args, eg:
+ # exim -i 'test@zroe.org, t2@zroe.org' <<'EOF'
+ #
+ #
+ exim -d -t <<'EOF'
+From: i@dmarctest.b8.nz
+To: mailman@dev.fsf.org
+Subject: test2
+Reply-to: rtest@iankelling.org
This is a test message.
EOF
#!/bin/bash
source /a/bin/errhandle/err
+_errcatch_cleanup() {
+ echo 1 >~/.local/conflink
+}
usage() {
echo "$0: error: unexpected user"; exit 1
;;
esac
+
+echo 0 >~/.local/conflink
set -x
fi
source /a/bin/errhandle/err
+
+_errcatch_cleanup() {
+ echo 1 >~/.local/distro-begin
+}
+
source /a/bin/distro-functions/src/package-manager-abstractions
### setup logging
sudo dd of=/etc/systemd/system/keyscripton.service <<'EOF'
[Unit]
Description=Turn on automatic decryption of drives on boot
+# This is triggered by reboot and when keyscriptoff stops.
+
# tried using graphical.target, but it made my display manager restart before rebooting.
# generally, I don't think targets order shutdown like they do startup.
# So, I did systemd-analyze plot > something.svg, and picked a reliably started
WantedBy=keyscriptoff.service
EOF
sudo systemctl daemon-reload # needed if the file was already there
- sudo systemctl stop keyscripton.service
- # sudo systemctl start keyscripton.service
sudo systemctl enable keyscripton.service
sudo dd of=/etc/systemd/system/keyscriptoff.service <<'EOF'
| sudo dd of=$tmp
if ! diff -q /etc/initramfs-tools/modules $tmp &>/dev/null; then
sudo dd if=$tmp of=/etc/initramfs-tools/modules
- sudo /usr/sbin update-initramfs -u -k all
+ sudo /usr/sbin/update-initramfs -u -k all
fi
# initram auth keys get setup with rootsshsync
$script_dir/rootsshsync
#### setup bash for root
-for x in /a/c/{.bashrc,brc,.bash_profile,.profile,.inputrc,path_add_function}; do
+for x in /a/c/{.bashrc,brc,brc2,.bash_profile,.profile,.inputrc,path_add_function}; do
sudo -i <<EOF
PATH="/a/exe:$PATH"
lnf $x /root
/a/exe/ssh-emacs-setup
fi
+
+echo 0 >~/.local/distro-begin
echo "$0: $(date): ending now"
exit 0
#!/bin/bash -l
-# Copyright (C) 2016 Ian Kelling
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright (C) 2019 Ian Kelling
+# SPDX-License-Identifier: AGPL-3.0-or-later
### setup
source /a/bin/errhandle/err
src="$(readlink -f -- "${BASH_SOURCE[0]}")"; src=${src%/*} # directory of this file
+if [[ $EUID == 0 ]]; then
+ echo "$0: error: run as regular user" >&2
+ exit 1
+fi
+
+_errcatch_cleanup() {
+ echo 1 >~/.local/distro-end
+}
+
# shellcheck source=./pkgs
source $src/pkgs
######### begin stuff belonging at the end ##########
-
+echo 0 >~/.local/distro-end
if $pending_reboot; then
echo "$0: pending reboot and then finished. doing it now."
s reboot now
#!/bin/bash
-# Copyright (C) 2016 Ian Kelling
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright (C) 2019 Ian Kelling
+# SPDX-License-Identifier: AGPL-3.0-or-later
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
#!/bin/bash
-# Copyright (C) 2016 Ian Kelling
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright (C) 2019 Ian Kelling
+# SPDX-License-Identifier: AGPL-3.0-or-later
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
header :contains "list-id" "<gnu-prog.gnu.org>",
header :contains "list-id" "<www-discuss.gnu.org>",
header :contains "list-id" "<gnu-community-private.gnu.org>",
+ header :contains "list-id" "<gnu-system-discuss.gnu.org>",
header :contains "list-id" "<gvc.gnu.org>",
header :contains "list-id" "<discuss.blu.org>",
header :contains "list-id" "<Spdx-tech.lists.spdx.org>",
header :contains "list-id" "<gnu-prog.gnu.org>",
header :contains "list-id" "<www-discuss.gnu.org>",
header :contains "list-id" "<gnu-community-private.gnu.org>",
+ header :contains "list-id" "<gnu-system-discuss.gnu.org>",
header :contains "list-id" "<gvc.gnu.org>",
header :contains "list-id" "<discuss.blu.org>",
header :contains "list-id" "<Spdx-tech.lists.spdx.org>",
chars+=("MAILPING!")
fi
+
+ if ! make -q ~/.local/distro-begin || [[ $(<~/.local/distro-begin) != 0 ]]; then
+ chars+=("DISTRO-BEGIN!")
+ fi
+
+ if ! make -q ~/.local/distro-end || [[ $(<~/.local/distro-end) != 0 ]]; then
+ chars+=("DISTRO-END!")
+ fi
+
+ f=~/.local/conflink
+ if [[ -e $f ]]; then
+ cd /b/ds
+ now=$(date +%s)
+ fsec=$(stat -c%Y $f)
+ fmin=$(( (fsec - now ) / 60 + 1 ))
+ fminplus=$(( fmin + 60*24 ))
+ # Filesystem files get copied, so find any newer than the last run.
+ # The rest are hueristics:
+ # Given the last time we added a file in git, is that newer than the last conflink run.
+ # Given new files not added to git, were they modified more recently than the last conflink? but,
+ # push their modification time back by a day so we can develop them before needing to add them to git.
+ if (( $(date -d "$(git log --diff-filter=ACR --format=%aD -1)" +%s) > fsec )) || \
+ [[ $(find {/a/bin/ds,/p/c}{/filesystem,/machine_specific/$HOSTNAME/filesystem} -mmin $fmin -type f -print -quit 2>/dev/null) ]] \
+ || [[ $(find $(git ls-files -o --exclude-standard) -mmin $fminplus -type f -print -quit) ]]; then
+ chars+=("CONFLINK!")
+ fi
+ fi
+
+ if [[ ! -e $f || $(<$f) != 0 ]]; then
+ chars+=("CONFLINK!")
+ fi
+
+
## Clean the paniclog, but only up to 4 times per day, or else we
## should investigate.
loglog=/tmp/panicloglog-$(date --rfc-3339=date)