limosek-zaf/zaf

80 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-03-23 14:37:51 +01:00
#!/bin/sh
if [ -f /etc/zaf.conf ]; then
. /etc/zaf.conf
2016-03-24 15:46:42 +01:00
else
echo "Missing config file /etc/zaf.conf! Exiting."
exit 2
2016-03-23 14:37:51 +01:00
fi
. ${ZAF_LIB_DIR}/zaf.lib.sh
case $1 in
2016-03-23 17:25:18 +01:00
check-agent-config)
zaf_check_agent_config
;;
2016-03-23 14:37:51 +01:00
update)
zaf_update_repo
;;
2016-03-24 15:46:42 +01:00
show)
if [ -z "$2" ]; then
zaf_show_installed_plugins
else
zaf_show_plugin "$2"
fi
;;
2016-03-23 17:25:18 +01:00
list)
2016-03-24 15:46:42 +01:00
zaf_list_plugins
2016-03-23 14:37:51 +01:00
;;
2016-03-24 15:46:42 +01:00
list-items)
if [ -z "$2" ]; then
zaf_list_items
else
zaf_list_plugin_items "$2"
fi
;;
test-items)
zaf_show_plugin "$2" tst
2016-03-23 17:25:18 +01:00
;;
2016-03-23 14:37:51 +01:00
install)
zaf_install_plugin "$2"
;;
2016-03-23 17:25:18 +01:00
remove)
zaf_remove_plugin "$2"
;;
2016-03-24 15:46:42 +01:00
self-upgrade)
curl -s https://raw.githubusercontent.com/limosek/zaf/master/install.sh | sh
;;
2016-03-24 20:37:03 +01:00
self-remove)
if [ "$2" = "force" ]; then
rm -rf /etc/zaf.conf ${ZAF_PLUGINS_DIR} ${ZAF_REPO_DIR} ${ZAF_LIB_DIR} /usr/bin/zaf ${ZAF_AGENT_CONFIGD}/zap_*
else
echo "This will remove zaf from this computer and erase all configuration."
echo "To continue, please do $0 self-remove force"
fi
;;
2016-03-24 15:46:42 +01:00
2016-03-23 14:37:51 +01:00
*)
2016-03-24 15:46:42 +01:00
echo "$0 update To update repo"
echo "$0 list To list installed plugins"
echo "$0 show [plugin] To show installed plugins or plugin info"
echo "$0 list-items [plugin] To list all suported items [for plugin]"
echo "$0 test-items plugin To test all suported items for plugin"
echo "$0 install plugin To install plugin"
echo "$0 remove plugin To remove plugin"
echo "$0 self-upgrade To self-upgrade zaf"
2016-03-23 14:37:51 +01:00
;;
2016-03-23 17:25:18 +01:00
2016-03-23 14:37:51 +01:00
esac