remaster/src/func/check_config

56 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-05-20 21:02:45 +02:00
#!/bin/bash
#remaster lib
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
2018-05-20 23:44:26 +02:00
#check_config
2018-05-20 21:53:56 +02:00
function check_config() {
2018-05-20 22:52:20 +02:00
#Project
[ -f "<LIBDIR>/proj/$distro" ] || {
2018-05-20 23:44:26 +02:00
echo "No Project \"$distro\" is not supported"
2018-05-20 22:52:20 +02:00
return 3
}
2018-05-20 22:53:00 +02:00
#live-system files
2018-05-20 22:44:33 +02:00
if [ -f "$iso_source" ]; then
if [ -n "$iso_destination" ] && [ -d "${iso_destination%/*}" ]; then
2018-05-20 22:55:54 +02:00
#Lable
[ -z "$iso_lable" ] && iso_lable="$distro"
2018-05-20 23:44:26 +02:00
echo 'iso_source -> iso_destination'
echo 'iso_source -> squashfs [optinal]'
2018-05-20 22:44:33 +02:00
else
if [ -n "$filesystem_source" ] && [ -d "${filesystem_source%/*}" ]; then
2018-05-20 23:44:26 +02:00
echo 'iso_source -> squashfs'
2018-05-20 22:44:33 +02:00
else
# ERROR
2018-05-20 23:44:26 +02:00
echo "No corect AIM in Settings"
2018-05-20 22:44:33 +02:00
return 3
fi
fi
else
if [ -f "$filesystem_source" ]; then
if [ -n "$iso_destination" ]; then
# ERROR
2018-05-20 23:44:26 +02:00
echo "only Squashfs source in Settings, cant creat ISO"
2018-05-20 22:44:33 +02:00
return 3
else
2018-05-20 23:44:26 +02:00
echo 'squashfs -> squashfs'
2018-05-20 22:44:33 +02:00
fi
else
# ERROR
2018-05-20 23:44:26 +02:00
echo "No corect Source in Settings"
2018-05-20 22:44:33 +02:00
return 3
fi
fi
2018-05-20 22:53:00 +02:00
2018-05-20 21:02:45 +02:00
}
#this func is standalone executable
[ -n "$1" ] && {
2018-05-20 21:53:56 +02:00
check_config $@
2018-05-20 21:02:45 +02:00
}