Add reboot back with attempted fix, add shell choice, always create a new user
This commit is contained in:
parent
a37423ff21
commit
b122c92e2e
@ -117,6 +117,10 @@ _ExtPartBody1="\nWhere do you want the partition mounted?\n\nEnsure the name beg
|
|||||||
_KernelTitle="Choose Kernel"
|
_KernelTitle="Choose Kernel"
|
||||||
_KernelBody="\nSelect which kernel to use for the install."
|
_KernelBody="\nSelect which kernel to use for the install."
|
||||||
|
|
||||||
|
# shell
|
||||||
|
_ShellTitle="Choose Login Shell"
|
||||||
|
_ShellBody="\nSelect which shell to use as the new user's login shell."
|
||||||
|
|
||||||
# Partitioning Menu
|
# Partitioning Menu
|
||||||
_PartTitle="Partitioning Tool"
|
_PartTitle="Partitioning Tool"
|
||||||
_PartBody="\nWhole device auto partitioning is available for beginners.\n\nUEFI systems require a vfat/fat32 partition between 100-512M in size to be mounted at /boot or /boot/efi, additionally BIOS systems using LUKS require a separate /boot partition, between 100-512M and formatted as ext3 or ext4."
|
_PartBody="\nWhole device auto partitioning is available for beginners.\n\nUEFI systems require a vfat/fat32 partition between 100-512M in size to be mounted at /boot or /boot/efi, additionally BIOS systems using LUKS require a separate /boot partition, between 100-512M and formatted as ext3 or ext4."
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
# globals {
|
# globals {
|
||||||
|
|
||||||
# immutable values
|
# immutable values
|
||||||
readonly VER="1.7.14" # Installer version
|
readonly VER="1.7.15" # Installer version
|
||||||
readonly DIST="ArchLabs" # Linux distributor
|
readonly DIST="ArchLabs" # Linux distributor
|
||||||
readonly LIVE="liveuser" # Live session user
|
|
||||||
readonly MNT="/mnt/install" # Install mountpoint
|
readonly MNT="/mnt/install" # Install mountpoint
|
||||||
readonly ERR="/tmp/errlog" # Built-in error log
|
readonly ERR="/tmp/errlog" # Built-in error log
|
||||||
|
readonly DBG="/tmp/debuglog" # Built-in error log
|
||||||
|
|
||||||
# mutable values
|
# mutable values
|
||||||
declare -g WARN=false
|
declare -g WARN=false
|
||||||
@ -45,6 +45,7 @@ declare -g INSTALL_WMS=""
|
|||||||
declare -g KERNEL=""
|
declare -g KERNEL=""
|
||||||
declare -g WM_PACKAGES=""
|
declare -g WM_PACKAGES=""
|
||||||
declare -g PACKAGES=""
|
declare -g PACKAGES=""
|
||||||
|
declare -g MYSHELL=""
|
||||||
declare -g MKINIT_HOOKS="shutdown"
|
declare -g MKINIT_HOOKS="shutdown"
|
||||||
|
|
||||||
# }
|
# }
|
||||||
@ -307,7 +308,7 @@ select_login_method() {
|
|||||||
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
WM_PACKAGES+=" lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice"
|
||||||
EDIT_FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
|
EDIT_FILES[11]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf"
|
||||||
else
|
else
|
||||||
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
|
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +475,6 @@ display_system_settings() {
|
|||||||
|
|
||||||
------------ SYSTEM CONFIGURATION -------------
|
------------ SYSTEM CONFIGURATION -------------
|
||||||
|
|
||||||
User: ${NEWUSER:-None}
|
|
||||||
Locale: ${LOCALE:-None}
|
Locale: ${LOCALE:-None}
|
||||||
Keymap: ${KEYMAP:-None}
|
Keymap: ${KEYMAP:-None}
|
||||||
Hostname: ${HOSTNAME:-None}
|
Hostname: ${HOSTNAME:-None}
|
||||||
@ -483,6 +483,8 @@ display_system_settings() {
|
|||||||
|
|
||||||
------------ LOGIN CONFIGURATION --------------
|
------------ LOGIN CONFIGURATION --------------
|
||||||
|
|
||||||
|
User: ${NEWUSER:-None}
|
||||||
|
Shell: ${MYSHELL:-None}
|
||||||
Session: ${LOGIN_WM:-None}
|
Session: ${LOGIN_WM:-None}
|
||||||
Autologin: ${AUTOLOGIN:-None}
|
Autologin: ${AUTOLOGIN:-None}
|
||||||
Management: ${LOGIN_TYPE:-None}
|
Management: ${LOGIN_TYPE:-None}
|
||||||
@ -512,6 +514,11 @@ configure_system_settings() {
|
|||||||
select_timezone || return 1
|
select_timezone || return 1
|
||||||
user_creation || return 1
|
user_creation || return 1
|
||||||
|
|
||||||
|
if ! MYSHELL="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||||
|
--title " $_ShellTitle " --menu "$_ShellBody" 0 0 0 '/bin/zsh' '-' '/bin/bash' '-')"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
tput civis
|
tput civis
|
||||||
if [[ $HAS_NETWORK == true ]]; then
|
if [[ $HAS_NETWORK == true ]]; then
|
||||||
if ! KERNEL="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
if ! KERNEL="$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||||
@ -530,7 +537,7 @@ configure_system_settings() {
|
|||||||
INSTALL_WMS='openbox'
|
INSTALL_WMS='openbox'
|
||||||
LOGIN_WM='openbox-session'
|
LOGIN_WM='openbox-session'
|
||||||
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
|
MIRROR_CMD="reflector --score 100 -l 50 -f 10 --sort rate --verbose"
|
||||||
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.zprofile /home/$NEWUSER/.xprofile"
|
EDIT_FILES[11]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export CONFIG_DONE=true
|
export CONFIG_DONE=true
|
||||||
@ -546,7 +553,7 @@ edit_system_configs() {
|
|||||||
|
|
||||||
tput civis
|
tput civis
|
||||||
local exitstr
|
local exitstr
|
||||||
[[ $DEBUG == true ]] && exitstr="View Log & Exit" || exitstr="Exit"
|
[[ $DEBUG == true ]] && exitstr="View Log & Reboot" || exitstr="Reboot"
|
||||||
|
|
||||||
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
SELECTED=$(dialog --cr-wrap --stdout --backtitle "$BT" \
|
||||||
--title " $_EditTitle " --default-item $SELECTED --menu "$_EditBody" 0 0 0 \
|
--title " $_EditTitle " --default-item $SELECTED --menu "$_EditBody" 0 0 0 \
|
||||||
@ -555,8 +562,8 @@ edit_system_configs() {
|
|||||||
"9" "${BOOTLDR^}" "10" "Pacman.conf" "11" "${LOGIN_TYPE^}")
|
"9" "${BOOTLDR^}" "10" "Pacman.conf" "11" "${LOGIN_TYPE^}")
|
||||||
|
|
||||||
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
if [[ ! $SELECTED || $SELECTED -eq 1 ]]; then
|
||||||
[[ $DEBUG == true ]] && more /tmp/debug-log
|
[[ $DEBUG == true ]] && more $DEBUG
|
||||||
die
|
die 127
|
||||||
else
|
else
|
||||||
local existing_files=""
|
local existing_files=""
|
||||||
for f in $(printf "%s" "${EDIT_FILES[$SELECTED]}"); do
|
for f in $(printf "%s" "${EDIT_FILES[$SELECTED]}"); do
|
||||||
|
@ -28,11 +28,8 @@ install() {
|
|||||||
# update the mirrorlist.. MUST be done before updating or it may be slow
|
# update the mirrorlist.. MUST be done before updating or it may be slow
|
||||||
oneshot mirrorlist_sort
|
oneshot mirrorlist_sort
|
||||||
|
|
||||||
# MUST be before bootloader and mkinitcpio
|
# MUST be before bootloader and running mkinitcpio
|
||||||
oneshot package_operations
|
oneshot package_operations
|
||||||
|
|
||||||
# set up user login.. MUST be done after package operation
|
|
||||||
oneshot login_manager
|
|
||||||
else
|
else
|
||||||
chrun 'pacman -Rns archlabs-installer --noconfirm'
|
chrun 'pacman -Rns archlabs-installer --noconfirm'
|
||||||
fi
|
fi
|
||||||
@ -45,9 +42,12 @@ install() {
|
|||||||
# hwclock setup, falls back to setting --directisa if the default fails
|
# hwclock setup, falls back to setting --directisa if the default fails
|
||||||
chrun "hwclock --systohc --utc" || chrun "hwclock --systohc --utc --directisa"
|
chrun "hwclock --systohc --utc" || chrun "hwclock --systohc --utc --directisa"
|
||||||
|
|
||||||
# create the user last to avoid referencing multiple $HOME locations for liveuser/newuser
|
# create the user
|
||||||
oneshot create_user
|
oneshot create_user
|
||||||
|
|
||||||
|
# set up user login.. MUST be done after package operation and user creation
|
||||||
|
oneshot login_manager
|
||||||
|
|
||||||
# drop off the user at the config editing menu
|
# drop off the user at the config editing menu
|
||||||
edit_system_configs
|
edit_system_configs
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ install_base() {
|
|||||||
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
|
rsync -ah --info=progress2 /run/archiso/sfs/airootfs/ $MNT/
|
||||||
|
|
||||||
# remove archiso init files and clean up install files
|
# remove archiso init files and clean up install files
|
||||||
rm -rf $MNT/etc/{sudoers.d/g_wheel,mkinitcpio-archiso.conf,polkit-1/rules.d/49-nopasswd_global.rules}
|
rm -rf $MNT/etc/{sudoers.d/g_wheel,mkinitcpio-archiso.conf}
|
||||||
find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm '{}' \;
|
find $MNT/usr/lib/initcpio -name 'archiso*' -type f -exec rm '{}' \;
|
||||||
|
|
||||||
# cleanup system permissions
|
# cleanup system permissions
|
||||||
@ -140,35 +140,38 @@ create_user() {
|
|||||||
# set root password
|
# set root password
|
||||||
chrun "chpasswd <<< 'root:$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$ROOT_PASS")'"
|
chrun "chpasswd <<< 'root:$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$ROOT_PASS")'"
|
||||||
|
|
||||||
# edit the group and passwd files in /etc/ to swap the liveuser account
|
# Create the user, set password, then remove temporary password file
|
||||||
sed -i "s/${LIVE}/${NEWUSER}/g" $MNT/etc/{group,gshadow,passwd,shadow}
|
local groups='audio,autologin,floppy,log,network,rfkill,scanner,storage,optical,power,wheel'
|
||||||
|
chrun "groupadd -r autologin"
|
||||||
if [[ -d $MNT/home/$NEWUSER ]]; then
|
chrun "useradd -m -u 1000 -g users -G $groups -s $MYSHELL $NEWUSER" 2>$ERR
|
||||||
rm -rf ${MNT:?}/home/$LIVE
|
|
||||||
else
|
|
||||||
# fix up some user files that reference the liveuser
|
|
||||||
sed -i "s/${LIVE}/${NEWUSER}/g" $MNT/home/$LIVE/.config/gtk-3.0/bookmarks \
|
|
||||||
$MNT/home/$LIVE/.mozilla/firefox/archlabs.default/{prefs,sessionstore}.js
|
|
||||||
# remove welcome message
|
|
||||||
sed -i '/printf/d' $MNT/home/$LIVE/.zshrc
|
|
||||||
[[ $INSTALL_WMS =~ bspwm ]] || rm -rf $MNT/home/$LIVE/.config/{bspwm,sxhkd}
|
|
||||||
[[ $INSTALL_WMS =~ i3-gaps ]] || rm -rf $MNT/home/$LIVE/.config/i3
|
|
||||||
[[ $INSTALL_WMS =~ openbox ]] || rm -rf $MNT/home/$LIVE/.config/{openbox,skippy-xd,jgmenu,conky,tint2}
|
|
||||||
[[ $INSTALL_WMS =~ (openbox|i3-gaps|bspwm) ]] || rm -rf $MNT/home/$LIVE/.config/polybar
|
|
||||||
chrun "mv -f /home/$LIVE /home/$NEWUSER"
|
|
||||||
fi
|
|
||||||
chrun "usermod -aG rfkill,wheel,network,storage,power,video,audio,lp,autologin $NEWUSER"
|
|
||||||
chrun "chpasswd <<< '$NEWUSER:$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$USER_PASS")'"
|
chrun "chpasswd <<< '$NEWUSER:$(openssl enc -pbkdf2 -a -d -salt -pass pass:$SALT <<< "$USER_PASS")'"
|
||||||
chrun "chown -Rf $NEWUSER:users /home/$NEWUSER"
|
chrun "chown -Rf $NEWUSER:users /home/$NEWUSER"
|
||||||
|
|
||||||
|
# remove welcome message
|
||||||
|
[[ $INSTALL_WMS =~ bspwm ]] || rm -rf $MNT/home/$NEWUSER/.config/{bspwm,sxhkd}
|
||||||
|
[[ $INSTALL_WMS =~ i3-gaps ]] || rm -rf $MNT/home/$NEWUSER/.config/i3
|
||||||
|
[[ $INSTALL_WMS =~ openbox ]] || rm -rf $MNT/home/$NEWUSER/.config/{openbox,skippy-xd,jgmenu,conky,tint2}
|
||||||
|
[[ $INSTALL_WMS =~ (openbox|i3-gaps|bspwm) ]] || rm -rf $MNT/home/$NEWUSER/.config/polybar
|
||||||
|
|
||||||
|
# for neovim copy the default vimrc and colorscheme to ~/.config/nvim
|
||||||
|
if [[ $PACKAGES =~ neovim ]]; then
|
||||||
|
mkdir -p $MNT/home/$NEWUSER/.config/nvim
|
||||||
|
cp -f $MNT/home/$NEWUSER/.vimrc $MNT/home/$NEWUSER/.config/nvim/init.vim
|
||||||
|
cp -rf $MNT/home/$NEWUSER/.vim/colors $MNT/home/$NEWUSER/.config/nvim/colors
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ $INSTALL_WMS =~ dwm ]] && suckless_install
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
login_manager() {
|
login_manager() {
|
||||||
local service="$MNT/etc/systemd/system/getty@tty1.service.d"
|
local service="$MNT/etc/systemd/system/getty@tty1.service.d"
|
||||||
|
|
||||||
|
# remove welcome message
|
||||||
|
sed -i '/printf/d' $MNT/root/.zshrc
|
||||||
|
|
||||||
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
|
if [[ $LOGIN_TYPE == 'lightdm' ]]; then
|
||||||
rm -rf $service
|
rm -rf $service
|
||||||
for f in $MNT/home/$LIVE/.{xinitrc,zprofile}; do
|
|
||||||
sed -i '/^#\|^$/! s/^/# /' $f
|
|
||||||
done
|
|
||||||
chrun 'systemctl enable lightdm.service && systemctl set-default graphical.target'
|
chrun 'systemctl enable lightdm.service && systemctl set-default graphical.target'
|
||||||
cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF
|
cat > $MNT/etc/lightdm/lightdm-gtk-greeter.conf << EOF
|
||||||
# LightDM GTK+ Configuration
|
# LightDM GTK+ Configuration
|
||||||
@ -182,22 +185,29 @@ icon-theme-name=Adwaita
|
|||||||
font-name=DejaVu Sans Mono 11
|
font-name=DejaVu Sans Mono 11
|
||||||
position=30%,end 50%,end
|
position=30%,end 50%,end
|
||||||
EOF
|
EOF
|
||||||
else # xinit login
|
else
|
||||||
sed -i "s/openbox-session/${LOGIN_WM}/g" $MNT/home/$LIVE/.xinitrc
|
# xinit login
|
||||||
if grep -q '#exec' $MNT/home/$LIVE/.zprofile; then
|
if [[ -e $MNT/home/$NEWUSER/.xinitrc ]]; then
|
||||||
sed -i 's/#exec/exec/' $MNT/home/$LIVE/.zprofile
|
sed -i "s/openbox-session/${LOGIN_WM}/g" $MNT/home/$NEWUSER/.xinitrc
|
||||||
elif grep -q 'exec sudo archlabs-installer' $MNT/home/$LIVE/.zprofile; then
|
|
||||||
sed -i 's|exec sudo archlabs-installer|exec startx -- vt1 >/dev/null 2>&1|' $MNT/home/$LIVE/.zprofile
|
|
||||||
else
|
else
|
||||||
cat > $MNT/home/$LIVE/.zprofile << EOF
|
printf "%s\n" "exec $LOGIN_WM" > $MNT/home/$NEWUSER/.xinitrc
|
||||||
if [[ ! \$DISPLAY && \$XDG_VTNR -eq 1 ]]; then
|
fi
|
||||||
|
|
||||||
|
# automatic startx for login shells
|
||||||
|
[[ $MYSHELL == '/bin/bash' ]] && local loginrc=".bash_profile" || local loginrc=".zprofile"
|
||||||
|
EDIT_FILES[11]+="/home/$NEWUSER/$loginrc"
|
||||||
|
|
||||||
|
cat >> $MNT/home/$NEWUSER/$loginrc << EOF
|
||||||
|
# ~/$loginrc
|
||||||
|
# sourced by $(basename $MYSHELL) when used as a login shell
|
||||||
|
|
||||||
|
# automatically run startx when logging in on tty1
|
||||||
|
if [ -n "\$DISPLAY" ] && [ \$XDG_VTNR -eq 1 ]; then
|
||||||
exec startx -- vt1 >/dev/null 2>&1
|
exec startx -- vt1 >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $AUTOLOGIN == true ]]; then
|
if [[ $AUTOLOGIN == true ]]; then
|
||||||
sed -i "s/${LIVE}/${NEWUSER}/g" $service/autologin.conf
|
sed -i "s/root/${NEWUSER}/g" $service/autologin.conf
|
||||||
else
|
else
|
||||||
rm -rf $service
|
rm -rf $service
|
||||||
fi
|
fi
|
||||||
@ -219,7 +229,7 @@ run_mkinitcpio() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mirrorlist_sort() {
|
mirrorlist_sort() {
|
||||||
printf "%s\n\n" "Sorting the mirrorlist"
|
printf "\n\n%s\n\n" "Sorting the mirrorlist"
|
||||||
if hash reflector >/dev/null 2>&1; then
|
if hash reflector >/dev/null 2>&1; then
|
||||||
$MIRROR_CMD --save $MNT/etc/pacman.d/mirrorlist --verbose ||
|
$MIRROR_CMD --save $MNT/etc/pacman.d/mirrorlist --verbose ||
|
||||||
reflector --score 100 -l 50 -f 10 \
|
reflector --score 100 -l 50 -f 10 \
|
||||||
@ -264,20 +274,17 @@ package_operations() {
|
|||||||
chrun "pacman -S iputils --noconfirm; pacman -S base-devel git --needed --noconfirm"
|
chrun "pacman -S iputils --noconfirm; pacman -S base-devel git --needed --noconfirm"
|
||||||
chrun "pacman -S $inpkg --needed --noconfirm"
|
chrun "pacman -S $inpkg --needed --noconfirm"
|
||||||
chrun "pacman -Rs $rmpkg --noconfirm"
|
chrun "pacman -Rs $rmpkg --noconfirm"
|
||||||
|
return 0
|
||||||
# for neovim copy the default vimrc and colorscheme to ~/.config/nvim
|
}
|
||||||
if [[ $inpkg =~ neovim ]]; then
|
|
||||||
mkdir -p $MNT/home/$LIVE/.config/nvim
|
suckless_install() {
|
||||||
cp -f $MNT/home/$LIVE/.vimrc $MNT/home/$LIVE/.config/nvim/init.vim
|
# install and setup dwm
|
||||||
cp -rf $MNT/home/$LIVE/.vim/colors $MNT/home/$LIVE/.config/nvim/colors
|
printf "\n\n%s\n\n" "Installing and setting up dwm."
|
||||||
fi
|
mkdir -pv $MNT/home/$NEWUSER/suckless
|
||||||
|
for i in dwm dmenu st; do
|
||||||
# install and setup dwm
|
p="/home/$NEWUSER/suckless/$i"
|
||||||
if [[ $INSTALL_WMS =~ dwm ]]; then
|
chrun "git clone https://bitbucket.org/natemaia/$i $p && { cd $p; rm -f $p/config.h 2>/dev/null; make clean install && make clean; }"
|
||||||
mkdir -pv $MNT/home/$LIVE/suckless
|
done
|
||||||
for i in dwm dmenu st; do
|
printf "\n\n%s\n\n" "To configure dwm edit /home/$NEWUSER/suckless/dwm/config.h and recompile with 'sudo make clean install'"
|
||||||
p="/home/$LIVE/suckless/$i"
|
sleep 2
|
||||||
chrun "git clone https://bitbucket.org/natemaia/$i $p && { cd $p; rm -f $p/config.h 2>/dev/null; make clean install && make clean; }"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,18 @@ ssd() {
|
|||||||
die() {
|
die() {
|
||||||
local exitcode=0
|
local exitcode=0
|
||||||
(( $# == 0 )) || exitcode=$1
|
(( $# == 0 )) || exitcode=$1
|
||||||
tput cnorm; unmount_install_partitions; exit $exitcode
|
tput cnorm
|
||||||
|
if [[ -d $MNT ]] && cd; then
|
||||||
|
fuser -km $MNT
|
||||||
|
unmount_install_partitions
|
||||||
|
|
||||||
|
if [[ $exitcode -eq 127 ]]; then
|
||||||
|
fuser -km /run/archiso/bootmnt
|
||||||
|
umount -l /run/archiso/bootmnt
|
||||||
|
systemctl -i reboot
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
exit $exitcode
|
||||||
}
|
}
|
||||||
|
|
||||||
sigint() {
|
sigint() {
|
||||||
@ -166,9 +177,9 @@ echeck() {
|
|||||||
[[ $err != "" ]] && msgbox "$_ErrTitle" "$msg\n\nWith the following error message:\n\n$err"
|
[[ $err != "" ]] && msgbox "$_ErrTitle" "$msg\n\nWith the following error message:\n\n$err"
|
||||||
|
|
||||||
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoice"
|
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoice"
|
||||||
if [[ -e /tmp/debug-log && $TERM == 'linux' ]]; then
|
if [[ -e $DBG && $TERM == 'linux' ]]; then
|
||||||
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoiceConsole"
|
msg="$([[ $err == "" ]] && printf "%s" "$msg")\n$_ErrChoiceConsole"
|
||||||
yesno "$_ErrTitle" "$msg" "Exit & Open Log" "Ignore & Continue" && { more /tmp/debug-log; die; }
|
yesno "$_ErrTitle" "$msg" "Exit & Open Log" "Ignore & Continue" && { more $DBG; die; }
|
||||||
else
|
else
|
||||||
yesno "$_ErrTitle" "$msg" "Exit" "Ignore & Continue" && die
|
yesno "$_ErrTitle" "$msg" "Exit" "Ignore & Continue" && die
|
||||||
fi
|
fi
|
||||||
@ -198,13 +209,13 @@ yesno() {
|
|||||||
|
|
||||||
debug() {
|
debug() {
|
||||||
set -x
|
set -x
|
||||||
exec 3>| /tmp/debug-log
|
exec 3>| $DBG
|
||||||
BASH_XTRACEFD=3
|
BASH_XTRACEFD=3
|
||||||
if [[ $DISPLAY && $TERM != 'linux' ]]; then
|
if [[ $DISPLAY && $TERM != 'linux' ]]; then
|
||||||
if hash 'termite' >/dev/null 2>&1; then
|
if hash 'termite' >/dev/null 2>&1; then
|
||||||
termite -e "tail -f /tmp/debug-log" &
|
termite -e "tail -f $DBG" &
|
||||||
else
|
else
|
||||||
xterm -e "tail -f /tmp/debug-log" &
|
xterm -e "tail -f $DBG" &
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
export DEBUG=true
|
export DEBUG=true
|
||||||
|
Reference in New Issue
Block a user