remaster/src/func/check_config

56 lines
1.3 KiB
Plaintext
Raw Normal View History

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