# see t.org for how to call
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
cd $(dirname $(readlink -f "$BASH_SOURCE"))
#!/bin/bash -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
for x in /etc/*.pacorig; do
# This started breaking immediately when I stoped doing genfstab.
set -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
if [[ ! $1 ]]; then
echo "error: expect a hostname in \$1 "
# Requires manually downloading image to /a/opt, and set it's name below.
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
cd /a/opt
#iso="archlinux-2015.11.01-dual"
# DISTRO_NAME is based on the partition names in /boot. eg boot_debianjessie
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
[[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@"
#!/bin/bash
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
usage() {
cat <<EOF
#!/bin/bash
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
[[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@"
# then start a virtual machine to test the config.
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
cd $(dirname $(readlink -f "$BASH_SOURCE"))
# then start a virtual machine to test the config.
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
redeploy=false
if [[ $1 == -r ]]; then
demohost)
echo "FAIBASE DEBIAN DESKTOP STABLE" ;;
x2)
- echo "FAIBASE DEBIAN DESKTOP STABLE PARTITION_PROMPT" ;;
+ echo "FAIBASE DEBIAN DESKTOP PARTITION_PROMPT" ;;
tp)
- echo "FAIBASE DEBIAN DESKTOP STABLE PARTITION_PROMPT" ;;
+ echo "FAIBASE DEBIAN DESKTOP PARTITION_PROMPT" ;;
frodo)
echo "FAIBASE DEBIAN DESKTOP STABLE PARTITION_PROMPT" ;;
# faiserver)
#!/bin/bash -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
#!/bin/bash -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
# # fai's setup-storage won't do btrfs on luks,
# # so we do it ourself :)
#!/bin/bash -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
$ROOTCMD adduser --disabled-password --gecos ian ian
fi
fi
- usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
- if [ $usedm -ne 0 ]; then
- if [ ! -d $target/etc/lvm ]; then
- echo ERROR: Found lvm devices, but the lvm2 package was not installed
- error=1
- fi
- fi
+ # # commented because it does false possitive
+ # usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
+ # if [ $usedm -ne 0 ]; then
+ # if [ ! -d $target/etc/lvm ]; then
+ # echo ERROR: Found lvm devices, but the lvm2 package was not installed
+ # error=1
+ # fi
+ # fi
fi
# remove backup files from cfengine, but only if cfengine is installed
set -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
cd $(dirname $(readlink -f "$BASH_SOURCE"))
# initial setup of a fai server on debian
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@"
#!/bin/bash
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@"
cat >/root/finish-resize <<'EOF'
#!/bin/bash -x
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
EOF
chmod +x /root/finish-resize
fi
# default distro is the base debian/fedora type. others are fai & arch
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
if [[ ! $1 ]]; then
echo "$0: error: exptected 1 argument of type"
#!/bin/bash
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
# ssh
#!/bin/bash
set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
h=root@192.168.1.1
scp /a/bin/fai/wrt-setup /a/bin/bash-programs-by-ian/repos/cedit/cedit $h:/usr/bin