used TELEBIT_PATH/usr/share, replace 'vim' with 'edit', change sudo_cmd

This commit is contained in:
AJ ONeal 2018-06-05 05:00:09 +00:00 committed by AJ ONeal
parent ec3c0eb14a
commit d6fcb467a9
1 changed files with 9 additions and 5 deletions

View File

@ -46,6 +46,10 @@ sudo_cmd="sudo"
# TODO detect if rsync is available and use rsync -a (more portable) # TODO detect if rsync is available and use rsync -a (more portable)
rsync_cmd="cp -pPR" rsync_cmd="cp -pPR"
if [ "root" == $(whoami) || 0 == $(id -u) ]; then
sudo_cmd=""
fi
if [ -z "${my_email}" ]; then if [ -z "${my_email}" ]; then
echo "" echo ""
echo "" echo ""
@ -218,7 +222,7 @@ if [ ! -e "$my_config" ]; then
echo " $my_servernames: {}" >> "$my_config" echo " $my_servernames: {}" >> "$my_config"
fi fi
#echo "dynamic_ports:\n []" >> "$my_config" #echo "dynamic_ports:\n []" >> "$my_config"
cat usr/share/$my_app.tpl.yml >> "$my_config" cat $TELEBIT_PATH/usr/share/$my_app.tpl.yml >> "$my_config"
fi fi
my_config_link="/etc/$my_app/$my_app.yml" my_config_link="/etc/$my_app/$my_app.yml"
@ -242,7 +246,7 @@ if [ ! -e "$my_config" ]; then
if [ -n "$my_secret" ]; then if [ -n "$my_secret" ]; then
echo "secret: $my_secret" >> "$my_config" echo "secret: $my_secret" >> "$my_config"
fi fi
cat usr/share/$my_app.tpl.yml >> "$my_config" cat $TELEBIT_PATH/usr/share/$my_app.tpl.yml >> "$my_config"
fi fi
echo "sudo chown -R $my_user '$TELEBIT_PATH' '/etc/$my_app'" echo "sudo chown -R $my_user '$TELEBIT_PATH' '/etc/$my_app'"
@ -306,7 +310,7 @@ if [ "systemd" == "$my_system_launcher" ]; then
echo "Edit the config and restart, if desired:" echo "Edit the config and restart, if desired:"
echo "" echo ""
echo " sudo vim /opt/$my_app/etc/$my_app.yml" echo " sudo edit /opt/$my_app/etc/$my_app.yml"
echo " sudo systemctl restart $my_app" echo " sudo systemctl restart $my_app"
echo "" echo ""
echo "Or disabled the service and start manually:" echo "Or disabled the service and start manually:"
@ -319,7 +323,7 @@ elif [ "launchd" == "$my_system_launcher" ]; then
echo "Edit the config and restart, if desired:" echo "Edit the config and restart, if desired:"
echo "" echo ""
echo " sudo vim /opt/$my_app/etc/$my_app.yml" echo " sudo edit /opt/$my_app/etc/$my_app.yml"
echo " sudo launchctl unload $my_root/$my_app_launchd_service" echo " sudo launchctl unload $my_root/$my_app_launchd_service"
echo " sudo launchctl load -w $my_root/$my_app_launchd_service" echo " sudo launchctl load -w $my_root/$my_app_launchd_service"
echo "" echo ""
@ -332,7 +336,7 @@ else
echo "Edit the config, if desired:" echo "Edit the config, if desired:"
echo "" echo ""
echo " sudo vim $my_config" echo " sudo edit $my_config"
echo "" echo ""
echo "Or disabled the service and start manually:" echo "Or disabled the service and start manually:"
echo "" echo ""