From 333a8a0ec5ea62785fda4c69e239d57e345467d5 Mon Sep 17 00:00:00 2001 From: u Date: Fri, 12 Mar 2021 02:42:48 -0500 Subject: new command: repenme --- repenme | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 repenme (limited to 'repenme') diff --git a/repenme b/repenme new file mode 100644 index 0000000..c2286ea --- /dev/null +++ b/repenme @@ -0,0 +1,18 @@ +#!/bin/sh +[ "$(id -u)" = 0 ] || exec sudo -- "$0" "$@" || exit +set -ex + +a=/root/.ssh/authorized_keys +b=$a~penme +c=$b~repen + +[ -f "$a" -a -f "$b" ] +[ -r "$a" -a -r "$b" ] + +mv -f -- "$a" "$c" +mv -- "$b" "$a" +mv -- "$c" "$b" +if [ -t 1 ] +then + diff "$b" "$a" +fi -- cgit v1.2.3