From: Ian Kelling Date: Thu, 27 Oct 2016 01:29:53 +0000 (-0700) Subject: fix keyscript X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=6839d9f20561f21d773dc17587c6b026bfebef5e fix keyscript --- diff --git a/distro-end b/distro-end index 392bcef..b19c41d 100755 --- a/distro-end +++ b/distro-end @@ -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) diff --git a/input-setup b/input-setup index 1cd3f6f..9f93cde 100755 --- a/input-setup +++ b/input-setup @@ -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 ;; diff --git a/keyscript-off b/keyscript-off index ed16201..c4ac8d5 100755 --- a/keyscript-off +++ b/keyscript-off @@ -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 diff --git a/keyscript-on b/keyscript-on index 71e19f0..54a655c 100755 --- a/keyscript-on +++ b/keyscript-on @@ -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 diff --git a/postfix-setup b/postfix-setup index 2d187fe..9401365 100755 --- a/postfix-setup +++ b/postfix-setup @@ -28,7 +28,7 @@ fi if isdeb; then s debconf-set-selections <