various fixes
authorIan Kelling <ian@iankelling.org>
Sun, 8 May 2016 22:34:50 +0000 (15:34 -0700)
committerIan Kelling <ian@iankelling.org>
Sun, 19 Jun 2016 01:00:24 +0000 (18:00 -0700)
distro-begin
distro-end

index 07b19b39023486e8ffb30116906b0965b45b494a..d870fe6af293a4a5929b31f1cf7d85d87325d3c5 100755 (executable)
@@ -359,13 +359,11 @@ case $(distro-name) in
         pi xorg-server redshift xorg-xinput pkgfile libxtst xmacro
         # like apt-cache
         s pkgfile --update
-        ;;&
-esac
 
-# background:
-# https://aur.archlinux.org/packages/xkbset/#comment-545419
-cert=$(mktemp)
-cat >$cert <<'EOF'
+        # background:
+        # https://aur.archlinux.org/packages/xkbset/#comment-545419
+        cert=$(mktemp)
+        cat >$cert <<'EOF'
 -----BEGIN CERTIFICATE-----
 MIIJADCCB+igAwIBAgIRAIVAhZ0TMbQ5jTm0koI8X6YwDQYJKoZIhvcNAQELBQAw
 djELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1JMRIwEAYDVQQHEwlBbm4gQXJib3Ix
@@ -486,8 +484,15 @@ L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
 jjxDah2nGN59PRbxYvnKkKj9
 -----END CERTIFICATE-----
 EOF
-cat /etc/ssl/certs/ca-certificates.crt >> $cert
-CURL_CA_BUNDLE=$cert pi xkbset
+        cat /etc/ssl/certs/ca-certificates.crt >> $cert
+        CURL_CA_BUNDLE=$cert pi xkbset
+
+        ;;&
+    ubuntu|debian|fedora)
+        pi xkbset
+        ;;&
+esac
+
 
 pi xbindkeys cryptsetup
 
@@ -536,8 +541,11 @@ frodo:/k  /kfrodo  nfs  defaults  0 0
 EOF
 fi
 
-for x in i w k; do
-    s mount /$i || [[ $? == 32 ]] # 32 = already mounted
+for dir in /{i,w,k}; do
+    if mountpoint $dir; then continue; fi
+    s mkdir -p $dir
+    s chown ian:ian $dir
+    s mount $dir
 done
 
 
index 3ebc231f1510932151f88ad263380034d2888de7..a30963f5d0e1240db3c5eff77dfbbecba08cbe71 100755 (executable)
@@ -1040,12 +1040,12 @@ tu /etc/hosts <<< "127.0.1.1 $(hostname).lan $(hostname)"
 rootdev=$(mount | sed -rn 's#^(\S+) on / .*#\1#p')
 s mkdir /mnt/root
 tu /etc/fstab <<< "$rootdev  /mnt/root  btrfs  noatime,subvolid=0  0 0"
-s mount /mnt/root || [[ $? == 32 ]]
+mountpoint /mnt/root || s mount /mnt/root
 idev=$(mount | sed -rn 's#^(\S+) on /i .*#\1#p')
 if [[ $idev != $rootdev ]]; then
     s mkdir /mnt/iroot
     tu /etc/fstab <<< "$idev  /mnt/iroot  btrfs  noatime,subvolid=0  0 0"
-    s mount /mnt/iroot || [[ $? == 32 ]]
+    mountpoint /mnt/iroot || s mount /mnt/iroot
 fi
 
 # Do this again because it occasionally has changes and