u
This commit is contained in:
parent
fd5f401430
commit
900293da36
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
read -p "Enable autologin as user? >>> " UserName
|
||||
if [ $UserName ]
|
||||
then
|
||||
sed -i "s/^.*autologin-user=.*$/autologin-user=$UserName/g" /etc/lightdm/lightdm.conf
|
||||
sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf
|
||||
echo "Successfully configured autologin as $UserName"
|
||||
else
|
||||
echo 'Nothing changed.'
|
||||
fi
|
||||
|
@ -60,7 +60,7 @@ echo
|
||||
# Debian 10 default to /bin/sh
|
||||
sed -i "s|/home/$NewUser:/bin/sh$|/home/$NewUser:/bin/bash|g" /etc/passwd
|
||||
# Debian 9 default to empty
|
||||
sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash/g" /etc/passwd
|
||||
sed -i "s|/home/$NewUser:$|/home/$NewUser:/bin/bash|g" /etc/passwd
|
||||
|
||||
echo "<<< Allow the new user $NewUser to sudo without password"
|
||||
#### Option 1: Add the new user to %sudo group in /etc/sudoers file
|
||||
@ -83,9 +83,16 @@ sed -i "s|^PermitRootLogin yes|#PermitRootLogin yes|g" /etc/ssh/sshd_config
|
||||
service sshd restart
|
||||
echo
|
||||
|
||||
#echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf"
|
||||
#sed -i "s/^#autologin-user=$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf
|
||||
#sed -i "s/^#autologin-user-timeout=0$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf
|
||||
echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf"
|
||||
read -p "<<< Enable xfce autologin as ($NewUser for autologin or anything else for no change): " XfceAutologinUsername
|
||||
if [ $XfceAutologinUsername = $NewUser ]
|
||||
then
|
||||
sed -i "s/^.*autologin-user=.*$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf
|
||||
sed -i "s/^.*autologin-user-timeout=.*$/autologin-user-timeout=0/g" /etc/lightdm/lightdm.conf
|
||||
echo "Successfully configured autologin as $NewUser"
|
||||
else
|
||||
echo 'Nothing changed >>>'
|
||||
fi
|
||||
|
||||
echo "<<< Configure autostart"
|
||||
if [ -f /etc/rc.local ]
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Usage: setup.sh [nodeVersion]"
|
||||
echo "Usage: this-script.sh [nodeVersion]"
|
||||
|
||||
defaultVersion=16
|
||||
|
||||
@ -8,7 +8,7 @@ if [ v$1 != v ]
|
||||
then
|
||||
nodeVersion=$1
|
||||
else
|
||||
read -p "Enter nodejs version (leave blank for default 16; 'nvm' for nvm) >> " nodeVersion
|
||||
read -p "Enter nodejs version (leave blank for default $defaultVersion) >> " nodeVersion
|
||||
if [ ! $nodeVersion ]
|
||||
then
|
||||
nodeVersion=$defaultVersion
|
||||
@ -16,10 +16,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $nodeVersion == 'nvm' ]
|
||||
then
|
||||
echo "######## Installing nvm ############################"
|
||||
else
|
||||
sudo apt update
|
||||
echo "######## Installing C++ build tools for Linux ########"
|
||||
sudo apt install curl gcc g++ make python -y # Debian 11 has no python by default.
|
||||
@ -28,4 +24,3 @@ else
|
||||
echo From https://deb.nodesource.com/setup_$nodeVersion.x
|
||||
curl -sL https://deb.nodesource.com/setup_$nodeVersion.x | sudo bash - && sudo apt install nodejs -y
|
||||
echo "######## nodejs v$nodeVersion installed completely! ########"
|
||||
fi
|
||||
|
7
install-nvm.sh
Executable file
7
install-nvm.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Usage: this-script.sh"
|
||||
|
||||
defaultVersion=0.39.0
|
||||
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$defaultVersion/install.sh | bash
|
Loading…
Reference in New Issue
Block a user