Minor tweaks
parent
88a4f2af49
commit
edc63b83cb
|
|
@ -13,18 +13,16 @@ LINK="https://raw.githubusercontent.com/schizza/SWS-12500-custom-component/main/
|
||||||
FILENAME="iptables_redirect.sh"
|
FILENAME="iptables_redirect.sh"
|
||||||
SCRIPT_DIR="iptables_redirect"
|
SCRIPT_DIR="iptables_redirect"
|
||||||
|
|
||||||
|
|
||||||
P_HA=true
|
P_HA=true
|
||||||
P_ST=true
|
P_ST=true
|
||||||
|
|
||||||
declare -a HA_PATHS=(
|
declare -a HA_PATHS=(
|
||||||
|
"/homeassistant"
|
||||||
"$PWD"
|
"$PWD"
|
||||||
"$PWD/config"
|
"$PWD/config"
|
||||||
"/config"
|
"/config"
|
||||||
"/homeassistant"
|
|
||||||
"$HOME/.homeassistant"
|
"$HOME/.homeassistant"
|
||||||
"/usr/share/hassio/homeassistant"
|
"/usr/share/hassio/homeassistant"
|
||||||
"./HA"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
function info() { echo -e $2 "${GREEN_COLOR}$1${NO_COLOR}"; }
|
function info() { echo -e $2 "${GREEN_COLOR}$1${NO_COLOR}"; }
|
||||||
|
|
@ -208,8 +206,8 @@ exit_status $? "cat" \
|
||||||
echo -n "Setting 'exec.sh' script right privileges ... "
|
echo -n "Setting 'exec.sh' script right privileges ... "
|
||||||
chmod +x --quiet "$COMPLETE_PATH/exec.sh"
|
chmod +x --quiet "$COMPLETE_PATH/exec.sh"
|
||||||
exit_status $? "chmod" \
|
exit_status $? "chmod" \
|
||||||
"Filed to set +x on exec.sh" \
|
"Filed to set +x on exec.sh" \
|
||||||
"OK."
|
"OK."
|
||||||
|
|
||||||
echo -n "Creating 'runscript' ... "
|
echo -n "Creating 'runscript' ... "
|
||||||
cat >$COMPLETE_PATH/runscript <<-"EOF"
|
cat >$COMPLETE_PATH/runscript <<-"EOF"
|
||||||
|
|
@ -224,16 +222,16 @@ exit_status $? "cat" \
|
||||||
"OK."
|
"OK."
|
||||||
|
|
||||||
echo -n "Modifying configuration.yaml ... "
|
echo -n "Modifying configuration.yaml ... "
|
||||||
cat >> $HA_PATH/configuration.yaml <<EOF
|
cat >>$HA_PATH/configuration.yaml <<EOF
|
||||||
|
|
||||||
shell_command:
|
shell_command:
|
||||||
iptables_script: ./iptables_redirect/exec.sh
|
iptables_script: ./iptables_redirect/exec.sh
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
exit_status $? "cat" \
|
exit_status $? "cat" \
|
||||||
"Could not modify configuration.yaml" \
|
"Could not modify configuration.yaml" \
|
||||||
"OK." \
|
"OK." \
|
||||||
false
|
false
|
||||||
|
|
||||||
echo "Executing 'iptables_redirecet.sh' ..."
|
echo "Executing 'iptables_redirecet.sh' ..."
|
||||||
|
|
||||||
|
|
@ -263,4 +261,3 @@ info " First run of 'iptables_redirect.sh' script " -n
|
||||||
[ $FIRST_RUN -ne 0 ] && { error " failed." false; } || { info " passed."; }
|
[ $FIRST_RUN -ne 0 ] && { error " failed." false; } || { info " passed."; }
|
||||||
|
|
||||||
info " SSH pub_key: at $COMPLETE_PATH/ssh/ipt_dsa.pub"
|
info " SSH pub_key: at $COMPLETE_PATH/ssh/ipt_dsa.pub"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue