setup swap in one command

This commit is contained in:
Robin Appelman 2021-04-14 23:30:30 +02:00
commit 7956df6dfd

View file

@ -103,9 +103,8 @@ async fn setup(ssh: &mut SshSession, config: &ServerConfig) -> Result<(), Error>
ssh.exec("dd if=/dev/zero of=/swapfile bs=1M count=1024") ssh.exec("dd if=/dev/zero of=/swapfile bs=1M count=1024")
.await?; .await?;
ssh.exec("chmod 600 /swapfile").await?; ssh.exec("chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile")
ssh.exec("mkswap /swapfile").await?; .await?;
ssh.exec("swapon /swapfile").await?;
Ok(()) Ok(())
} }