# to be idempotent if we fail after partitioning
already_partitioned=true
mount_out=$(mount)
-for dir in /mnt{,/home,/boot,/q}; do
+for dir in /mnt{,/home,/boot,/a}; do
regex=" on $dir "
if [[ ! $mount_out =~ $regex ]]; then
already_partitioned=false
if ! $already_partitioned; then
mount -o subvol=root_$DISTRO $ROOT_PARTITION /mnt
- mkdir -p /mnt/{q,home,boot}
- mount -o subvol=q $ROOT_PARTITION /mnt/q
+ mkdir -p /mnt/{a,home,boot}
+ mount -o subvol=a $ROOT_PARTITION /mnt/a
mount -o subvol=boot_$DISTRO $BOOT_PARTITION /mnt/boot
fi
mkdir -p $mountpoint
mount -o bind $source $mountpoint
}
-bindmount /a /mnt/a
bindmount /root/shadow /mnt/q/root/shadow
mkdir -p /mnt/etc/ssh
echo "$0: warning: no pw set for $user" >&2
fi
}
-au() {
- if ! $ROOTCMD getent passwd $1; then
- $ROOTCMD useradd -m -s /bin/bash $1 || [[ $? == 9 ]]
+au() { # add user
+ if ! $ROOTCMD getent passwd ${@: -1}; then
+ $ROOTCMD useradd -m -s /bin/bash $@
fi
}
dir=$(dirname $dir)
if [[ $dir == /p ]]; then break; fi
done
+
+au -s /bin/false --home-dir /var/lib/bitcoind bitcoin
chmod +x $f
+# for hosts which don't have these data volumes, copy the specific
+# files we need.
if ifclass demohost; then
files=(/var/lib/fai/config/distro-install-common/luks/host-demohost)
elif ifclass tp; then
# man page doesn't explain this, but this deletes & thus disables
# all chboot systems.
type -t host &>/dev/null || apt-get -y install dnsutils
-gateway_ip=$(route -n | sed -rn 's/^(0\.){3}0\s+(\S+).*/\2/p')
+gateway_ip=$(route -n | sed -rn 's/^0\.0\.0\.0\s+(\S+).*/\1/p')
my_ip=$(host faiserver $gateway_ip | sed -rn 's/^\S+ has address //p')
k_args=$(fai-chboot -L '^default$' | \
sed -r "s/^(\S+\s+){3}(.*root=)(.*)/\2$my_ip:\3/")
# EOF
+v cedit /etc/config/network <<'EOF' || v /etc/init.d/network reload
+config 'route' 'transmission'
+ option 'interface' 'lan'
+ option 'target' '10.173.0.0'
+ option 'netmask' '255.255.0.0'
+ option 'gateway' '192.168.1.2'
+EOF
v cedit /etc/config/firewall <<'EOF' || firewall_restart=true
config redirect
72.14.176.105 li
45.33.1.160 lj
138.68.10.24 dopub
-# cant ssh to do when on vpn. some routing/firewall rule or something,
-# I don't know. I can get there from wrt but not my machine.
-# but we can get to it from this address, so, good enough.
-10.8.0.1 do
+# netns creation looks for next free subnet starting at 10.173, but I only
+# use one, and I would keep this one as the first created.
+10.173.0.2 transmission
EOF