aboutsummaryrefslogtreecommitdiff
path: root/system/zramen/rc.zramen
blob: 97cb5fa324c91b806c39d45f6b84bb6c1e7b1973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Start/stop/restart zramen (manages zram swap space)

# Source options
if [ -r /etc/default/zramen ]; then
  . /etc/default/zramen
fi

zramen_start() {
 if [ -x /usr/bin/zramen ]; then
 /usr/bin/zramen make
 fi
}

zramen_stop() {
 if [ -x /usr/bin/zramen ]; then
 /usr/bin/zramen toss
 fi
}

zramen_restart() {
 zramen_stop
 sleep 1
 zramen_start
}

case "$1" in
'start')
  zramen_start
  ;;
'stop')
  zramen_stop
  ;;
'restart')
  zramen_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac