pkg_post_save() { [ -f /mod/etc/conf/usbroot.cfg ] && . /mod/etc/conf/usbroot.cfg if [ "$USBROOT_ENABLED" == "yes" ]; then if [ -z "$USBROOT_DEVICE" ]; then echo "Error: No USB device specified." return 1 fi # if not root directory trim trailing slash [ "$USBROOT_USBPATH" != '/' ] && USBROOT_USBPATH="${USBROOT_USBPATH%/}" echo 'Saving settings ...' /mod/etc/init.d/rc.usbroot store \ "$USBROOT_DEVICE:$USBROOT_FSTYPE${USBROOT_FSTYPE:+:}${USBROOT_USBPATH:-/}" \ "${USBROOT_MNTOPTIONS// /}" echo 'done.' echo 'Activating USB root ...' /mod/etc/init.d/rc.usbroot on echo 'done.' else echo 'Deactivating USB root ...' /mod/etc/init.d/rc.usbroot off echo 'done.' fi } pkg_post_def() { /mod/etc/init.d/rc.usbroot off /mod/etc/init.d/rc.usbroot nostore }