diff --git a/src/build_dpkg.sh b/src/build_dpkg.sh index 68130a0be..5fa956acd 100755 --- a/src/build_dpkg.sh +++ b/src/build_dpkg.sh @@ -40,7 +40,7 @@ mkdir -p $DEBIAN_DIR $LQOS_DIR/bin/static2 $ETC_DIR $MOTD_DIR # Create the Debian control file pushd $DEBIAN_DIR > /dev/null || exit -cat < control +cat << EOF > control Package: $PACKAGE Version: $VERSION Architecture: amd64 @@ -53,7 +53,7 @@ popd > /dev/null || exit # Create the post-installation file pushd $DEBIAN_DIR > /dev/null || exit -cat < postinst +cat << 'EOF' > postinst #!/bin/bash # Install Python Dependencies pushd /opt/libreqos > /dev/null || exit @@ -70,8 +70,8 @@ cp /opt/libreqos/src/bin/lqosd.service.example /etc/systemd/system/lqosd.service cp /opt/libreqos/src/bin/lqos_scheduler.service.example /etc/systemd/system/lqos_scheduler.service service_exists() { - local n=\$1 - if [[ \$(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == \$n.service ]]; then + local n=$1 + if [[ $(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == $n.service ]]; then return 0 else return 1 @@ -103,7 +103,7 @@ fi EOF # Uninstall Script -cat < postrm +cat << EOF > postrm #!/bin/bash /bin/systemctl --no-block stop lqosd lqos_scheduler /bin/systemctl disable lqosd lqos_scheduler @@ -145,9 +145,9 @@ popd || exit #################################################### # Add Message of the Day pushd $MOTD_DIR > /dev/null || exit -cat < 99-libreqos +cat << 'EOF' > 99-libreqos #!/bin/bash -MY_IP=\`hostname -I | cut -d' ' -f1\` +MY_IP=`hostname -I | cut -d' ' -f1` echo -e "\nLibreQoS Traffic Shaper is installed on this machine. \nPoint a browser at http://\$MY_IP:9123/ to manage it.\n" EOF