Skip to content

Commit

Permalink
Swapfile enable/disable scripts+service
Browse files Browse the repository at this point in the history
  • Loading branch information
shermand100 committed Jul 6, 2019
1 parent b650cb3 commit ba6e07f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions etc/systemd/system/disable-swap.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=2GB system swap-file disable
After=network.target

[Service]
ExecStart=/bin/bash disable-swap.sh
WorkingDirectory=/home/pinodexmr/
StandardOutput=inherit
StandardError=inherit
Type=oneshot
RemainAfterExit=true
Restart=no
User=pinodexmr

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions etc/systemd/system/enable-swap.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=2GB system swap file enable
After=network.target

[Service]
ExecStart=/bin/bash enable-swap.sh
WorkingDirectory=/home/pinodexmr/
StandardOutput=inherit
StandardError=inherit
Type=oneshot
RemainAfterExit=true
Restart=no
User=pinodexmr

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions home/pinodexmr/disable-swap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo dphys-swapfile swapoff
2 changes: 2 additions & 0 deletions home/pinodexmr/enable-swap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo dphys-swapfile swapon

0 comments on commit ba6e07f

Please sign in to comment.