# set the scrollback to unlimited in case something goes wrong
if [[ $EUID == 0 ]]; then
- if getent passwd ian; then
+ if getent passwd iank || getent passwd ian ; then
echo "$0: error: running as root. unprivileged user exists. use it."
exit 1
else
distro=$(distro-name)
case $distro in
ubuntu|debian|trisquel)
- sudo bash -c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-ian"
+ sudo bash -c ". /a/bin/fai/fai-wrapper && /a/bin/fai/fai/config/scripts/GRUB_PC/11-iank"
;;
*)
sudo bash -c ". /a/bin/fai/fai-wrapper &&
# passwordless sudo
-tu /etc/sudoers <<'EOF'
-ian ALL=(ALL) NOPASSWD: ALL
+tu /etc/sudoers <<EOF
+$USER ALL=(ALL) NOPASSWD: ALL
Defaults env_keep += SUDOD
# makes ubuntu be like debian
# https://unix.stackexchange.com/a/91572
dirs=(/mnt/{1,2,3,4,5,6,7,8,9})
s mkdir -p "${dirs[@]}"
-s chown ian:ian "${dirs[@]}"
+s chown $USER:$USER "${dirs[@]}"
tu /etc/fstab <<'EOF'
if ! mountpoint /kr; then
s mkdir -p /kr
- s chown ian:traci /kr
+ s chown $USER:traci /kr
fi
if home_network; then
- if [[ $HOSTNAME == treetowl ]]; then
+ if [[ $HOSTNAME == frodo ]]; then
tu /etc/fstab <<'EOF'
/k /kr none bind,noauto 0 0
EOF
for dir in /{i,w,k}; do
if mountpoint $dir; then continue; fi # already mounted
s mkdir -p $dir
- s chown ian:ian $dir
+ s chown $USER:$USER $dir
done
# not needed for all hosts, but rather just keep it uniform
EOF
s chmod +x /root/imount
- s dd of=/etc/systemd/system/imount.service <<'EOF'
+ s dd of=/etc/systemd/system/imount.service <<EOF
[Unit]
Description=Mount /i and related mountpoints
-Before=syncthing@ian.service
+Before=syncthing@$USER.service
[Service]
Type=oneshot
ExecStart=/root/imount
[Install]
-RequiredBy=syncthing@ian.service
+RequiredBy=syncthing@$USER.service
# note /kr needs networking, this target is the simplest way to
# time it when the network should be up, but not do something
# dumb like delay startup until the network is up. It happens
$first_root_crypt /nocow btrfs noatime,subvol=nocow 0 0
EOF
s mkdir -p $dir
- s chown ian:ian $dir
+ s chown $USER:$USER $dir
s mount $dir
fi
else
# ownership, and ssh doesn\'t allow any group writable parent
# directories, so we are forced to use a directory structure similar
# to home directories
-s chown root:ian /q
+s chown root:$USER /q
s chmod 755 /q
s mkdir -p $dir/PostLogin
s command cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default
s mkdir /etc/lightdm/lightdm.conf.d
- s dd of=/etc/lightdm/lightdm.conf.d/12-ian.conf <<'EOF'
+ s dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF'
[SeatDefaults]
session-setup-script=/a/bin/distro-setup/desktop-20-autostart.sh
EOF