Code Sample |
#!/bin/bash cd $HOME/mydsl/optional #change to location of *.uci files for i in *.uci; do grep -q "\/$i " /etc/mtab [ "$?" == "0" ] && i="${i}(M)" [ -n "$UCI_LIST" ] && UCI_LIST="$UCI_LIST,$i" || UCI_LIST="$i" #this check might be unnecessary done UCI_FILE=`echo "$UCI_LIST" | tr ',' '\n' | dmenu` #or wmiimenu [ -n "$UCI_FILE" ] && mydsl-load ${UCI_FILE%(M)} |
Code Sample |
#!/bin/bash cd $HOME/mydsl/optional for i in *.uci; do grep -q "\/$i " /etc/mtab [ "$?" == "0" ] && i="${i}(M)" UCI_LIST=`echo -e "$UCI_LIST\n$i"` done UCI_FILE=`echo "$UCI_LIST" | grep -v ^$ | dmenu` [ -n "$UCI_FILE" ] && mydsl-load ${UCI_FILE%(M)} |