move some stuff to frodo, rename user to iank, fixes
[distro-setup] / distro-begin
index dde7c8e6afd9f3c67fa5785b55ae540988680100..214c33f95e6cf99b6b9a9090d771db1af44625f5 100755 (executable)
@@ -30,7 +30,7 @@ sudo bash -c 'source /a/c/.bashrc && source /a/exe/ssh-emacs-setup'
 # 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
@@ -167,7 +167,7 @@ fi
 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 &&
@@ -207,8 +207,8 @@ $interactive || set -x
 
 
 # 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
@@ -543,7 +543,7 @@ fi
 
 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'
@@ -554,11 +554,11 @@ 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
@@ -573,7 +573,7 @@ s mkdir -p /q /i/{w,k}
 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
@@ -605,17 +605,17 @@ done
 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
@@ -642,7 +642,7 @@ if has_btrfs; then
 $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
@@ -653,7 +653,7 @@ fi
 # 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
 
 
@@ -742,7 +742,7 @@ if has_x; then
         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