* Re-wrote/cleaned up init scripts * Re-wrote init-functions * Moved some things (init scripts, defaults, configs) to other packages * Added update-rc which manages /etc/rc* directories * Added usher to manage defaults
40 lines
766 B
Bash
Executable File
40 lines
766 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: swap
|
|
# Required-Start: udev
|
|
# Required-Stop:
|
|
# Should-Start: modules
|
|
# Should-Stop:
|
|
# Default-Start: S
|
|
# Default-Stop: 0 6
|
|
# Short-Description: Mount and unmount swap partitions
|
|
# X-Required: true
|
|
### END INIT INFO
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
log_init_msg "Activating swap files/partitions"
|
|
swapon -a && log_success_msg || log_failure_msg
|
|
;;
|
|
stop)
|
|
log_init_msg "Deactivating swap files/partitions"
|
|
swapoff -a && log_success_msg || log_failure_msg
|
|
;;
|
|
restart)
|
|
${0} stop
|
|
sleep 1
|
|
${0} start
|
|
;;
|
|
status)
|
|
swapon --show
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [start|stop|restart|status]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|