forked from mirrored-repos/manjaro-tools
use sets dir
This commit is contained in:
parent
5f4136e6b8
commit
8305472b4f
2 changed files with 41 additions and 5 deletions
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
for n in $(ls -d $(pwd)/*);do
|
||||
echo ${n##*/} | sort > $1.set
|
||||
done
|
41
bin/make-set.in
Normal file
41
bin/make-set.in
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
manjaro_tools_conf='@sysconfdir@/manjaro-tools.conf'
|
||||
|
||||
if [[ -f ${manjaro_tools_conf} ]]; then
|
||||
. ${manjaro_tools_conf}
|
||||
fi
|
||||
|
||||
if [[ -n ${profiledir} ]];then
|
||||
profiledir=${profiledir}
|
||||
else
|
||||
profiledir='@sysconfdir@/sets'
|
||||
fi
|
||||
|
||||
name='default'
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -n <name> Set name without extension"
|
||||
echo ' -h This help'
|
||||
echo ''
|
||||
echo ''
|
||||
exit 1
|
||||
}
|
||||
|
||||
opts='n:h'
|
||||
|
||||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
n) name="$OPTARG" ;;
|
||||
h) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $EUID != 0 ]]; then
|
||||
die 'This script must be run as root.'
|
||||
else
|
||||
for n in $(ls -d $(pwd)/*);do
|
||||
echo ${n##*/} | sort > ${profiledir}/$1.set
|
||||
done
|
||||
fi
|
Loading…
Reference in a new issue