fix keyscript
authorIan Kelling <ian@iankelling.org>
Thu, 27 Oct 2016 01:29:53 +0000 (18:29 -0700)
committerIan Kelling <ian@iankelling.org>
Thu, 27 Oct 2016 01:29:53 +0000 (18:29 -0700)
distro-end
input-setup
keyscript-off
keyscript-on
postfix-setup

index 392bcef5d9e1ffeea304ea2836ec684e1afad68b..b19c41d0ba8bb856aeaaac58a8f43b005d48fd34 100755 (executable)
@@ -245,6 +245,19 @@ esac
 ########### end section including li/lj ###############
 
 
+if [[ $HOSTNAME == frodo ]]; then
+    case $distro in
+        ubunut|debian)
+            pi libsqlite3-dev
+            cd /a/opt/duperemove
+            make clean
+            make
+            s make install
+            ;;
+        #others unknown
+    esac
+fi
+
 case $distro in
     arch) pi syncthing ;;
     ubuntu|debian)
index 1cd3f6f52803ae837885c9189291e630dadf204f..9f93cde1f3dc2750951203cd162e8d25a980e5dc 100755 (executable)
@@ -22,7 +22,7 @@ set_device_id() {
 }
 
 case $HOSTNAME in
-       tp)
+       tp|x2)
                # original saved with: xkbcomp $DISPLAY /a/c/stretch-9-2016.xkb
                xkbcomp /a/c/tp.xkb $DISPLAY
                ;;
index ed16201539d206d4feef442c32c685e846e636ad..c4ac8d52eeeab9e3109fa31070d31c76b6910026 100755 (executable)
@@ -22,15 +22,18 @@ if [[ $- != *i* ]]; then
     echo "$0: starting. $(date)"
 fi
 
-if [[ $(sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
+sed="sed --follow-symlinks"
+
+if [[ $($sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
     if grep -q '^\s*FILES=' /etc/mkinitcpio.conf; then
-        sed -ri --follow-symlinks 's/^\s*FILES=/#\0/' /etc/mkinitcpio.conf # comment out
+        $sed -ri 's/^\s*FILES=/#\0/' /etc/mkinitcpio.conf # comment out
         mkinitcpio -p linux
     fi
 else
-    if grep -q '/root/keyscript-manual' /etc/crypttab; then
-        sed -i --follow-symlinks 's#/root/keyscript,#/root/keyscript-manual,#' /etc/crypttab
-        update-initramfs -u
+    x=/root/keyscript
+    if grep -q "${x}," /etc/crypttab; then
+        $sed -i "s#${x},#${x}-manual,#" /etc/crypttab
+       update-initramfs -u
     fi
 fi
 
index 71e19f0500f16d519a6997892b47bc25bf88e8d2..54a655cbec0eddc8ef83313b0d4d484ce24b72b4 100755 (executable)
@@ -23,16 +23,19 @@ if [[ $- != *i* ]]; then
 fi
 rootn=1
 
+sed="sed --follow-symlinks"
+
 if [[ ! -e /tmp/keyscript-off ]]; then
-    if [[ $(sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
+    if [[ $($sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
         if ! grep -q '^\s*FILES=' /etc/mkinitcpio.conf; then
-            sed -ri --follow-symlinks 's/^#(\s*FILES=.*)/\1/' /etc/mkinitcpio.conf # uncomment
+            $sed -ri 's/^#(\s*FILES=.*)/\1/' /etc/mkinitcpio.conf # uncomment
             mkinitcpio -p linux
         fi
     else
-        if grep -q '/root/keyscript,' /etc/crypttab; then
-            sed -i --follow-symlinks 's#/root/keyscript-manual,#/root/keyscript,#' /etc/crypttab
-            update-initramfs -u
+        x=/root/keyscript
+        if grep -q "${x}-manual," /etc/crypttab; then
+            $sed -i "s#${x}-manual,#${x},#" /etc/crypttab
+           update-initramfs -u
         fi
     fi
 fi
index 2d187fe47c3af33f251ee96efe7bbcb07f9a77a3..9401365e6d9132d42e065fe60a48369fc14b65d3 100755 (executable)
@@ -28,7 +28,7 @@ fi
 if isdeb; then
     s debconf-set-selections <<EOF
 postfix postfix/main_mailer_type select Satellite system
-postfix postfix/mailname string $host
+postfix postfix/mailname string $HOSTNAME
 postfix postfix/relayhost string $relayhost
 EOF