sunetdrive/templates/scriptreceiver/removeswap.erb.sh

10 lines
325 B
Bash
Raw Permalink Normal View History

2023-03-22 07:01:18 +00:00
#!/bin/bash
# Clean up old swap version
swapoff -a
cryptsetup remove cryptswap1
sed -i 's_^/dev/mapper/cryptswap1 none swap sw 0 0__' /etc/fstab
sed -i 's_/swapfile none swap sw 0 0__' /etc/fstab
sed -i 's_cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64__' /etc/crypttab
rm /swapfile
rm /cryptswap1