Fixing swap issue
This commit is contained in:
parent
42ab8f31f9
commit
1e90067128
4
vps
4
vps
|
@ -9,7 +9,6 @@ set -xev
|
|||
ARCH=x86_64 # x86_64 or x86_64-musl
|
||||
DRIVE=/dev/vda
|
||||
HOSTNAME=blackhole
|
||||
SSH_PORT=22 # Change me
|
||||
SWAP_SIZE=1 # In GB (set to 0 to disable)
|
||||
TIMEZONE="America/New_York"
|
||||
USERNAME=supernets
|
||||
|
@ -47,6 +46,7 @@ setup_chroot() {
|
|||
|
||||
>/var/log/lastlog && chattr +i /var/log/lastlog
|
||||
|
||||
SSH_PORT=$(shuf -i 2023-65000 -n 1)
|
||||
printf '#!/bin/sh\nexec 2>&1\n[ -r conf ] && . ./conf\nexec dropbear -K 0 -p '"$SSH_PORT"' -R -m -w -t -T 1 -F 2>&1\n' > /etc/sv/dropbear/run
|
||||
printf "\nexport HISTFILE=/dev/null\nexport LESSHISTFILE=/dev/null\nexport PYTHONHISTFILE=/dev/null\n" >> /etc/profile
|
||||
printf "set boldtext\nset minibar\nset nohelp\nset nowrap\nset quickblank\nset tabsize 4\nunbind ^J main\nset selectedcolor black,red\ninclude \"/usr/share/nano/*.nanorc\"\n" > /etc/nanorc
|
||||
|
@ -78,7 +78,7 @@ setup_chroot() {
|
|||
echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> /etc/fstab
|
||||
|
||||
touch /swapfile
|
||||
COUNT=$(($SWAP_SIZE_GB * 1024))
|
||||
COUNT=$(($SWAP_SIZE * 1024))
|
||||
dd if=/dev/zero of=/swapfile bs=1M count=${COUNT} status=progress
|
||||
chmod 0600 /swapfile
|
||||
mkswap /swapfile && swapon /swapfile
|
||||
|
|
Loading…
Reference in New Issue