+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm/lightdm.conf
-
-# Remove dconf for live environment
-remove "/etc/dconf/db/local.d/02-disable-lock"
-
-# Replace menu source (enable screen lock)
-remove "/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js"
-mv "/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js.org" "/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js"
-
-
-# Update system datebase
-dconf update
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/Automatic*/#Automatic/g" "/etc/gdm/custom.conf"
-
-
-# Remove dconf for live environment
-remove "/etc/dconf/db/local.d/02-live-"*
-
-
-# Update system datebase
-dconf update
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm/lightdm.conf
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm/lightdm.conf
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm/lightdm.conf
set -e
+script_path="$( cd -P "$( dirname "$(readlink -f "${0}")" )" && pwd )"
+script_name="$(basename "$(realpath "${0}")")"
+
function remove () {
local list
local file
esac
done
+function remove_user_file(){
+ remove "/etc/skel/${@}"
+ remove "/home/${user}/${@}"
+}
+
+
remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
remove /usr/share/calamares/
+remove_user_file "Desktop/calamares.desktop"
+remove_user_file ".config/gtk-3.0/bookmarks"
+
+
remove /etc/polkit-1/rules.d/01-nopasswork.rules
# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
remove /root/.automated_script.sh
remove /etc/mkinitcpio-archiso.conf
remove /etc/initcpio
+# Delete systemd files
remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
remove /etc/systemd/system/getty@tty1.service.d
remove /etc/systemd/system/alteriso-reflector.service
+
+# Disabled auto login for LightDM
+if [[ -f "/etc/lightdm/lightdm.conf" ]]; then
+ sed -i "s/^autologin/#autologin/g" "/etc/lightdm/lightdm.conf"
+fi
+
+# Disabled auto login for GDM
+if [[ -f "/etc/gdm/custom.conf" ]]; then
+ sed -i "s/Automatic*/#Automatic/g" "/etc/gdm/custom.conf"
+fi
+
+# Remove dconf for live environment
+remove "/etc/dconf/db/local.d/02-disable-lock"
+remove "/etc/dconf/db/local.d/02-live-"*
+
+# Update system datebase
+if type dconf > /dev/null 2>&1 ; then
+ dconf update
+fi
+
+# 追加のスクリプトを実行
+if [[ -d "${script_path}/${script_name}.d/" ]]; then
+ for extra_script in "${script_path}/${script_name}.d/"*; do
+ bash -c "${extra_script} ${user}"
+ done
+fi
+++ /dev/null
-#!/usr/bin/env bash
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-if [[ -f /etc/systemd/journald.conf ]]; then
- sed -i 's / Storage = volatile /#Storage = auto /' /etc/systemd/journald.conf
-fi
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm.conf
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function remove () {
- local list
- local file
- list=($(echo "$@"))
- for file in "${list[@]}"; do
- if [[ -f ${file} ]]; then
- rm -f "${file}"
- elif [[ -d ${file} ]]; then
- rm -rf "${file}"
- fi
- done
-}
-
-while getopts 'u:' arg; do
- case "${arg}" in
- u) user="${OPTARG}";;
- esac
-done
-
-remove /etc/skel/Desktop
-remove /etc/skel/.config/gtk-3.0/bookmarks
-remove /home/${user}/Desktop/calamares.desktop
-remove /root/Desktop/calamares.desktop
-remove /home/${user}/.config/gtk-3.0/bookmarks
-remove /usr/share/calamares/
-
-remove /etc/polkit-1/rules.d/01-nopasswork.rules
-
-# Delete unnecessary files of archiso.
-# See the following site for details.
-# https://wiki.archlinux.jp/index.php/Archiso#Chroot_.E3.81.A8.E3.83.99.E3.83.BC.E3.82.B9.E3.82.B7.E3.82.B9.E3.83.86.E3.83.A0.E3.81.AE.E8.A8.AD.E5.AE.9A
-
-remove /etc/systemd/system/getty@tty1.service.d/autologin.conf
-remove /root/.automated_script.sh
-remove /etc/mkinitcpio-archiso.conf
-remove /etc/initcpio
-
-remove /etc/systemd/journald.conf.d/volatile-storage.conf
-remove /airootfs.any/etc/systemd/logind.conf.d/do-not-suspend.conf
-
-
-remove /etc/systemd/system/{choose-mirror.service,getty@tty1.service.d}
-
-# Disabled auto login
-sed -i "s/^autologin/#autologin/g" /etc/lightdm/lightdm.conf