1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
11 .
/lib
/functions
/mount.sh
15 config_mount_by_section
"$cfg"
20 config_swapon_by_section
"$cfg"
26 config_get target
"$cfg" target
27 config_get_bool enabled
"$cfg" "enabled" '1'
28 [ -n "$target" -a "$enabled" -gt 0 ] ||
return 0
35 config_get device
"$cfg" device
36 config_get_bool enabled
"$cfg" "enabled" '1'
37 [ -n "$device" -a "$enabled" -gt 0 ] && type swapoff
>/dev
/null ||
return 0
44 lock
/var
/lock
/fstab.lck
45 echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /etc
/fstab
46 lock
-u /var
/lock
/fstab.lck
47 config_foreach do_mount mount
48 config_foreach do_swapon swap
53 config_foreach do_unmount mount
54 config_foreach do_swapoff swap