chore: remove generated files from repo
This commit is contained in:
parent
7d2c56f81b
commit
78cffa1c12
@ -1,5 +0,0 @@
|
||||
package emissary
|
||||
|
||||
config main 'agent'
|
||||
option reconciliation_interval '60'
|
||||
option server_url 'https://emissary.cadol.es'
|
@ -1,35 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
START=50
|
||||
STOP=50
|
||||
|
||||
start_service() {
|
||||
config_load emissary
|
||||
|
||||
mkdir -p /usr/share/emissary
|
||||
mkdir -p /var/lib/emissary
|
||||
|
||||
config_get emissary_reconciliation_interval agent 'reconciliation_interval' "60"
|
||||
config_get emissary_server_url agent 'server_url' "https://emissary.cadol.es"
|
||||
|
||||
local config_file="/etc/emissary/agent.yml"
|
||||
procd_open_instance emissary-agent
|
||||
procd_set_param env EMISSARY_SERVER_URL="$emissary_server_url" EMISSARY_RECONCILIATION_INTERVAL="$emissary_reconciliation_interval"
|
||||
procd_set_param command /usr/local/bin/emissary
|
||||
procd_append_param command --workdir /usr/share/emissary
|
||||
procd_append_param command --config "$config_file"
|
||||
procd_append_param command agent run
|
||||
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
||||
procd_set_param file "$config_file"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param pidfile /var/run/emissary-agent.pid
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
# Reload service (restart) on emissary config changes
|
||||
procd_add_reload_trigger "emissary"
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
main() {
|
||||
local default_config="/etc/emissary/default.conf"
|
||||
|
||||
if [ ! -f "${default_config}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
source "${default_config}"
|
||||
|
||||
if [ ! -z "${EMISSARY_RECONCILIATION_INTERVAL}" ]; then
|
||||
uci set "emissary.agent.reconciliation_interval=${EMISSARY_RECONCILIATION_INTERVAL}"
|
||||
fi
|
||||
if [ ! -z "${EMISSARY_SERVER_URL}" ]; then
|
||||
uci set "emissary.agent.server_url=${EMISSARY_SERVER_URL}"
|
||||
fi
|
||||
|
||||
# Commit modifications
|
||||
uci commit
|
||||
|
||||
# Delete file
|
||||
rm -f "${default_config}"
|
||||
|
||||
/etc/init.d/emissary-agent enable
|
||||
}
|
||||
|
||||
main
|
@ -1,25 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
main() {
|
||||
local machine_id_file="/etc/machine-id"
|
||||
|
||||
if [ -f "$machine_id_file" ]; then
|
||||
echo "Machine ID already generated. Doing nothing."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Accumulate data to create unique machine id
|
||||
local mac_addresses=$(cat /sys/class/net/*/address | uniq | sort)
|
||||
local device_model=$(cat /sys/firmware/devicetree/base/model)
|
||||
local urandom_seed=$(cat /etc/urandom.seed | sha256sum | cut -d ' ' -f1)
|
||||
|
||||
# Ensure destination directory
|
||||
mkdir -p "$(dirname "$machine_id_file")"
|
||||
|
||||
# Generate SHA256 hash of data and save it to $machine_id_file
|
||||
echo "$mac_adresses $device_model $urandom_seed" | sha256sum | cut -d ' ' -f1 > "$machine_id_file"
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in New Issue
Block a user