diff --git a/RESOURCES/OPTIONS/app_images/app_images.sh b/RESOURCES/OPTIONS/app_images/app_images.sh index c0efff0..55ce5ec 100755 --- a/RESOURCES/OPTIONS/app_images/app_images.sh +++ b/RESOURCES/OPTIONS/app_images/app_images.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -image_set=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +image_set="$2" # check the project root folder if [ ! -d "$project_root" ]; then diff --git a/RESOURCES/OPTIONS/boot_resource/boot_resource.sh b/RESOURCES/OPTIONS/boot_resource/boot_resource.sh index 64bba68..0887727 100755 --- a/RESOURCES/OPTIONS/boot_resource/boot_resource.sh +++ b/RESOURCES/OPTIONS/boot_resource/boot_resource.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -boot_resource=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +boot_resource="$2" # check the project root folder if [ ! -d "$project_root" ]; then diff --git a/RESOURCES/OPTIONS/custom_update/custom_update.sh b/RESOURCES/OPTIONS/custom_update/custom_update.sh index edde343..14a75d1 100755 --- a/RESOURCES/OPTIONS/custom_update/custom_update.sh +++ b/RESOURCES/OPTIONS/custom_update/custom_update.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -public_key=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +public_key="$2" # check the project root folder if [ ! -d "$project_root" ]; then diff --git a/RESOURCES/OPTIONS/fswebcam/fswebcam.sh b/RESOURCES/OPTIONS/fswebcam/fswebcam.sh index 1cb89bf..4f8e230 100755 --- a/RESOURCES/OPTIONS/fswebcam/fswebcam.sh +++ b/RESOURCES/OPTIONS/fswebcam/fswebcam.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -fswebcam_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +fswebcam_package="$2" # check the required tools TOOL_LIST=("unzip") diff --git a/RESOURCES/OPTIONS/kobra_unleashed/kobra_unleashed.sh b/RESOURCES/OPTIONS/kobra_unleashed/kobra_unleashed.sh index 5cac4d5..36bcdcb 100755 --- a/RESOURCES/OPTIONS/kobra_unleashed/kobra_unleashed.sh +++ b/RESOURCES/OPTIONS/kobra_unleashed/kobra_unleashed.sh @@ -13,7 +13,7 @@ if [ $# != 2 ]; then fi def_target="$1/unpacked/squashfs-root/app/app" -def_url=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +def_url="$2" # check the input file if [ ! -f "$def_target" ]; then diff --git a/RESOURCES/OPTIONS/opkg/opkg.sh b/RESOURCES/OPTIONS/opkg/opkg.sh index 332c682..e5b4c30 100755 --- a/RESOURCES/OPTIONS/opkg/opkg.sh +++ b/RESOURCES/OPTIONS/opkg/opkg.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -opkg_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +opkg_package="$2" # check the required tools TOOL_LIST=("unzip") diff --git a/RESOURCES/OPTIONS/root_access/root_access.sh b/RESOURCES/OPTIONS/root_access/root_access.sh index 394f88d..ed1137f 100755 --- a/RESOURCES/OPTIONS/root_access/root_access.sh +++ b/RESOURCES/OPTIONS/root_access/root_access.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -password_hash=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +password_hash="$2" # check the project root folder if [ ! -d "$project_root" ]; then diff --git a/RESOURCES/OPTIONS/ssh/ssh.sh b/RESOURCES/OPTIONS/ssh/ssh.sh index 7e157da..d242838 100755 --- a/RESOURCES/OPTIONS/ssh/ssh.sh +++ b/RESOURCES/OPTIONS/ssh/ssh.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -ssh_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +ssh_package="$2" # check the required tools TOOL_LIST=("unzip") diff --git a/RESOURCES/OPTIONS/startup_script/startup_script.sh b/RESOURCES/OPTIONS/startup_script/startup_script.sh index 0c338e4..3833836 100755 --- a/RESOURCES/OPTIONS/startup_script/startup_script.sh +++ b/RESOURCES/OPTIONS/startup_script/startup_script.sh @@ -6,16 +6,16 @@ NC='\033[0m' # check the parameters if [ $# != 2 ]; then - echo "usage : $0 " + echo "usage : $0 " exit 1 fi project_root="$1" -startup_script_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +startup_script="$2" -# Check if startup.sh is available -if [ ! -f "$project_root/RESOURCES/OPTIONS/startup_script/startup.sh" ]; then - echo -e "${RED}ERROR: Cannot find the file 'startup.sh' ${NC}" +# Check if $startup_script is available +if [ ! -f "$project_root/RESOURCES/OPTIONS/startup_script/$startup_script" ]; then + echo -e "${RED}ERROR: Cannot find the file '$startup_script' ${NC}" exit 2 fi @@ -35,10 +35,10 @@ fi mkdir -p "$project_root/unpacked/squashfs-root/etc/ssl/certs" cp -rf "$project_root/RESOURCES/KEYS/mosquitto"/* "$project_root/unpacked/squashfs-root/etc/ssl/certs" -# Move startup.sh to project root/unpacked/squashfs-root/etc -cp -rf "$project_root/RESOURCES/OPTIONS/startup_script/startup.sh" "$project_root/unpacked/squashfs-root/etc" +# Move $startup_script to project root/unpacked/squashfs-root/etc +cp -rf "$project_root/RESOURCES/OPTIONS/startup_script/$startup_script" "$project_root/unpacked/squashfs-root/etc" -# Add /etc/startup.sh to $project_root/unpacked/squashfs-root/etc/rc.local before the exit 0 line -sed -i '/exit 0/i /etc/startup.sh' "$project_root/unpacked/squashfs-root/etc/rc.local" +# Add /etc/$startup_script to $project_root/unpacked/squashfs-root/etc/rc.local before the exit 0 line +sed -i "/exit 0/i /etc/$startup_script" "$project_root/unpacked/squashfs-root/etc/rc.local" exit 0 diff --git a/RESOURCES/OPTIONS/uart/uart.sh b/RESOURCES/OPTIONS/uart/uart.sh index 5ec6f84..d4a665b 100755 --- a/RESOURCES/OPTIONS/uart/uart.sh +++ b/RESOURCES/OPTIONS/uart/uart.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -uart_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +uart_package="$2" # check the required tools TOOL_LIST=("unzip") diff --git a/RESOURCES/OPTIONS/webcam/webcam.sh b/RESOURCES/OPTIONS/webcam/webcam.sh index 1ed2bdc..d0222ec 100755 --- a/RESOURCES/OPTIONS/webcam/webcam.sh +++ b/RESOURCES/OPTIONS/webcam/webcam.sh @@ -11,7 +11,7 @@ if [ $# != 2 ]; then fi project_root="$1" -webcam_package=$(echo "$2" | sed -e 's/^"//' -e 's/"$//') +webcam_package="$2" # check the required tools TOOL_LIST=("unzip") diff --git a/options.cfg b/options.cfg index 2405667..134b2f4 100644 --- a/options.cfg +++ b/options.cfg @@ -43,7 +43,7 @@ ssh="dropbear" # Replace the URL below with the URL of your MQTT server # You also need to transfer to the printer your keys in # the /user folder by ssh as explained in the project page -# kobra_unleashed="localhost.mr-a.de" +#kobra_unleashed="localhost.mr-a.de" # Replace some of the app images #app_images="set1"