summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/addswap
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.d/addswap')
-rwxr-xr-xetc/rc.d/addswap55
1 files changed, 5 insertions, 50 deletions
diff --git a/etc/rc.d/addswap b/etc/rc.d/addswap
index a6ff187..1758df8 100755
--- a/etc/rc.d/addswap
+++ b/etc/rc.d/addswap
@@ -13,57 +13,12 @@
. /etc/rc.subr
name="addswap"
-start_cmd="addswap_start"
-stop_cmd="addswap_stop"
+start_cmd=":"
+stop_cmd=":"
+rcvar=
-addswap_start()
-{
- case ${swapfile} in
- [Nn][Oo] | '')
- ;;
- *)
- if [ -w "${swapfile}" ]; then
- check_startmsgs && echo "Adding ${swapfile} as additional swap"
-
- if [ -n "${swapfile_mdunit}" ]; then
- mdev="/dev/md${swapfile_mdunit#md}"
- mdconfig -a -t vnode -f "${swapfile}" -u ${swapfile_mdunit}
- else
- mdev="/dev/`mdconfig -a -t vnode -f "${swapfile}"`"
- fi
-
- if [ $? -eq 0 ]; then
- swapon ${mdev}
- else
- echo "error creating swapfile device"
- fi
- fi
- ;;
- esac
-}
-
-addswap_stop()
-{
- case ${swapfile} in
- [Nn][Oo] | '')
- ;;
- *)
- if [ -n "${swapfile_mdunit}" ]; then
- mdev="/dev/md${swapfile_mdunit#md}"
- else
- mdev="/dev/`mdconfig -lv | grep "${swapfile}" | cut -f1`"
- swapfile_mdunit=${mdev#md}
- fi
- if [ -n "${swapfile_mdunit}" ]; then
- swapctl -l | grep -q ${mdev}
- if [ $? -eq 0 ]; then
- echo "Dismounting swapfile ${swapfile}"
- swapoff ${mdev} && mdconfig -d -u ${swapfile_mdunit}
- fi
- fi
- ;;
- esac
-}
+set_rcvar_obsolete swapfile
+set_rcvar_obsolete geli_swap_flags
load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud