Browse Source

Lowercase variable

pull/357/head
Xavier Petit 5 years ago
parent
commit
658315cc94
No known key found for this signature in database
GPG Key ID: CA3F2B17E25ABD26
  1. 10
      scripts/bash_tweaks.sh
  2. 4
      scripts/firewall.sh
  3. 10
      scripts/go.sh
  4. 4
      scripts/grub.sh
  5. 19
      scripts/install_client.sh
  6. 4
      scripts/ssh.sh
  7. 22
      scripts/ubuntu_tweaks.sh
  8. 10
      scripts/vscode.sh

10
scripts/bash_tweaks.sh

@ -37,13 +37,13 @@ fi
EOF
# Set-up all users
for DIR in $(ls -1d /root /home/* 2>/dev/null ||:)
for dir in $(ls -1d /root /home/* 2>/dev/null ||:)
do
# Hide login informations
touch $DIR/.hushlogin
touch $dir/.hushlogin
# Add convenient aliases & behaviors
cat <<-'EOF'>> $DIR/.bashrc
cat <<-'EOF'>> $dir/.bashrc
export LS_OPTIONS="--color=auto"
eval "`dircolors`"
@ -63,6 +63,6 @@ do
EOF
# Fix rights
USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev)
chown -R $USR:$USR $DIR ||:
usr=$(echo "$dir" | rev | cut -d/ -f1 | rev)
chown -R $usr:$usr $dir ||:
done

4
scripts/firewall.sh

@ -6,12 +6,12 @@ script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=${1:-521}
ssh_port=${1:-521}
apt-get -y install ufw
ufw logging off
ufw allow in "$SSH_PORT"/tcp
ufw allow in "$ssh_port"/tcp
ufw allow in 27960:27969/tcp
ufw allow in 27960:27969/udp
ufw --force enable

10
scripts/go.sh

@ -9,17 +9,17 @@ cd $script_dir
apt-get -y install golang
# Set-up all users
for DIR in $(ls -1d /root /home/* 2>/dev/null ||:)
for dir in $(ls -1d /root /home/* 2>/dev/null ||:)
do
# Add convenient aliases & behaviors
cat <<-'EOF'>> $DIR/.bashrc
cat <<-'EOF'>> $dir/.bashrc
GOPATH=$HOME/go
PATH=$PATH:$GOPATH/bin
alias gobuild='CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w"'
EOF
echo 'GOPATH=$HOME/go' >> $DIR/.profile
echo 'GOPATH=$HOME/go' >> $dir/.profile
# Fix rights
USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev)
chown -R $USR:$USR $DIR ||:
usr=$(echo "$dir" | rev | cut -d/ -f1 | rev)
chown -R $usr:$usr $dir ||:
done

4
scripts/grub.sh

@ -6,7 +6,7 @@ script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
DISK=$1
disk=$1
sed -i -e 's/message=/message_null=/g' /etc/grub.d/10_linux
@ -20,4 +20,4 @@ GRUB_DISABLE_SUBMENU=y
EOF
update-grub
grub-install $DISK
grub-install $disk

19
scripts/install_client.sh

@ -9,8 +9,7 @@ script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=521
DISK=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
disk=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
grep -e nvme -e sata |
grep '0 disk' |
cut -d' ' -f2 |
@ -19,10 +18,10 @@ DISK=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
systemctl stop unattended-upgrades.service
sgdisk -n0:0:+32G "$DISK"
sgdisk -N0 "$DISK"
sgdisk -c3:01-tmp-home "$DISK"
sgdisk -c4:01-tmp-system "$DISK"
sgdisk -n0:0:+32G "$disk"
sgdisk -N0 "$disk"
sgdisk -c3:01-tmp-home "$disk"
sgdisk -c4:01-tmp-system "$disk"
apt-get update
apt-get -y upgrade
@ -41,7 +40,7 @@ apt-get -yf install
. ssh.sh
. firewall.sh
. ubuntu_tweaks.sh
. grub.sh "$DISK"
. grub.sh "$disk"
. go.sh
. nodejs.sh
. fx.sh
@ -51,7 +50,7 @@ apt-get -yf install
. exam.sh
# Install additional packages
PKGS="
pkgs="
emacs
f2fs-tools
golang-mode
@ -59,7 +58,7 @@ vim
xfsprogs
"
apt-get -y install $PKGS
apt-get -y install $pkgs
# Install additional drivers
ubuntu-drivers install
@ -91,7 +90,7 @@ find . -type f -exec chmod 644 {} \;
find . -type f -exec /bin/sh -c "file {} | grep -q 'shell script' && chmod +x {}" \;
find . -type f -exec /bin/sh -c "file {} | grep -q 'public key' && chmod 400 {}" \;
sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules
sed -i -e "s|::DISK::|$disk|g" etc/udev/rules.d/10-local.rules
# Generate wallpaper
cd usr/share/backgrounds/01

4
scripts/ssh.sh

@ -6,13 +6,13 @@ script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=${1:-521}
ssh_port=${1:-521}
# Install dependencies
apt-get -y install ssh
cat <<EOF>> /etc/ssh/sshd_config
Port $SSH_PORT
Port $ssh_port
PasswordAuthentication no
AllowUsers root
EOF

22
scripts/ubuntu_tweaks.sh

@ -41,7 +41,7 @@ sed -i '/swapfile/d' /etc/fstab
# Purge unused Ubuntu packages
PKGS="
pkgs="
apport
bind9
bolt
@ -73,10 +73,10 @@ whoopsie
xdg-desktop-portal
"
apt-get -y purge $PKGS
apt-get -y purge $pkgs
apt-get -y autoremove --purge
SERVICES="
services="
apt-daily-upgrade.timer
apt-daily.timer
console-setup.service
@ -84,16 +84,16 @@ keyboard-setup.service
motd-news.timer
remote-fs.target
"
systemctl disable $SERVICES
systemctl disable $services
SERVICES="
services="
grub-common.service
plymouth-quit-wait.service
"
systemctl mask $SERVICES
systemctl mask $services
# Install packages
PKGS="$(cat common_packages.txt)
pkgs="$(cat common_packages.txt)
baobab
blender
dconf-editor
@ -109,8 +109,8 @@ zenity
"
# Replace debian packages with ubuntu's
PKGS=${PKGS/linux-image-amd64/linux-image-generic}
PKGS=${PKGS/linux-headers-amd64/linux-headers-generic}
PKGS=${PKGS/firmware-linux-nonfree}
pkgs=${pkgs/linux-image-amd64/linux-image-generic}
pkgs=${pkgs/linux-headers-amd64/linux-headers-generic}
pkgs=${pkgs/firmware-linux-nonfree}
apt-get -y install $PKGS
apt-get -y install $pkgs

10
scripts/vscode.sh

@ -12,11 +12,11 @@ dpkg -i codium_1.40.2-1574798581_amd64.deb
ln -s /usr/bin/codium /usr/local/bin/code
# Set-up all users
for DIR in $(ls -1d /home/* 2>/dev/null ||:)
for dir in $(ls -1d /home/* 2>/dev/null ||:)
do
# Disable most of the telemetry and auto-updates
mkdir -p $DIR/.config/VSCodium/User
cat <<-'EOF'> $DIR/.config/VSCodium/User/settings.json
mkdir -p $dir/.config/VSCodium/User
cat <<-'EOF'> $dir/.config/VSCodium/User/settings.json
{
"telemetry.enableCrashReporter": false,
"update.enableWindowsBackgroundUpdates": false,
@ -31,6 +31,6 @@ do
EOF
# Fix rights
USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev)
chown -R $USR:$USR $DIR ||:
usr=$(echo "$dir" | rev | cut -d/ -f1 | rev)
chown -R $usr:$usr $dir ||:
done

Loading…
Cancel
Save