2023-01-24 20:04:26 -08:00
|
|
|
{{- if (ne .host.distro.family "windows") -}}
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
#!/usr/bin/env bash
|
2023-04-11 15:03:34 -07:00
|
|
|
# @file `/var/log/user` Folders
|
2023-04-11 14:29:49 -07:00
|
|
|
# @brief Creates an empty directory for each user in `/var/log/user`
|
|
|
|
# @description
|
|
|
|
# This script creates an empty directory with each user's name in `/var/log/user`. It initializes the folder in hopes
|
|
|
|
# that we can eventually store all user logs in a single directory alongside the system logs folder.
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
|
2023-01-10 00:54:12 -08:00
|
|
|
{{ $homeDirs := (output "find" .host.homeParentFolder "-mindepth" "1" "-maxdepth" "1" "-type" "d") -}}
|
|
|
|
{{- range $homeDir := splitList "\n" $homeDirs -}}
|
|
|
|
{{- if ne $homeDir "" -}}
|
|
|
|
# home dir: {{ $homeDir }}
|
|
|
|
{{ end -}}
|
|
|
|
{{- end }}
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
|
2022-12-25 01:09:00 -08:00
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
|
|
|
|
2023-01-24 20:04:26 -08:00
|
|
|
find '{{ .host.homeParentFolder }}' -mindepth 1 -maxdepth 1 -type d | while read HOME_DIR; do
|
2023-01-12 07:02:13 -08:00
|
|
|
USER_FOLDER="$(echo "$HOME_DIR" | sed 's/.*\/\([^\/]*\)$/\1/')"
|
|
|
|
if [ -d "$HOME_DIR/.local" ]; then
|
|
|
|
if [ ! -d "/var/log/user/$USER_FOLDER" ]; then
|
2023-01-24 20:04:26 -08:00
|
|
|
logg info 'Creating `/var/log/user/'"$USER_FOLDER"'`'
|
|
|
|
sudo mkdir -p "/var/log/user/$USER_FOLDER"
|
2023-01-11 14:44:05 -08:00
|
|
|
fi
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
fi
|
|
|
|
done
|
2023-01-24 20:04:26 -08:00
|
|
|
|
|
|
|
{{ end -}}
|