Minor fixes for worktrack

This commit is contained in:
DarkFeather 2017-09-18 15:40:50 -05:00
parent ec85c68ea5
commit c02f701b2d
2 changed files with 5 additions and 24 deletions

View File

@ -1,4 +1,4 @@
LIST=bell bigorlittle compare-directories compress-all diff-args expand-all logged-shell standardize-folder whatismyip new-irssi-config replicate-ssh-profiles
LIST=bell bigorlittle compare-directories compress-all diff-args expand-all logged-shell standardize-folder whatismyip new-irssi-config replicate-ssh-profiles worktrack
LOCATION=/usr/local/bin
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash
PERMISSION=0755

View File

@ -3,23 +3,13 @@
command="$1"
option="$2"
# Sanity checks
if [ ! -x "$(which libreoffice)" ]; then
echo Needs libreoffice.
exit 1;
fi
if [ ! -f /opt/worktrack/template.odt ]; then
echo Needs template document in /opt/worktrack/template.odt
exit 1;
fi
case "$command" in
"new")
# Start a new project
mkdir -p ~/Documents/WorkTrack/"$option"
cp /opt/worktrack/template.odt ~/Documents/WorkTrack/"$option"/track.odt
chmod u+w ~/Documents/WorkTrack/"$option"/track.odt
exec libreoffice --writer ~/Documents/WorkTrack/"$option"/track.odt
cp /opt/worktrack/template.doc ~/Documents/WorkTrack/"$option"/track.doc
chmod u+w ~/Documents/WorkTrack/"$option"/track.doc
exec libreoffice --writer ~/Documents/WorkTrack/"$option"/track.doc
;;
"list")
# Show available projects
@ -39,16 +29,7 @@ case "$command" in
rm -Ri ~/Documents/WorkTrack/\.[a-zA-Z1-9]*
;;
"edit")
exec libreoffice --writer ~/Documents/WorkTrack/"$option"/track.odt
;;
"checkperm")
if [ `whoami` != "root" ]; then
echo "Need to be root."
exit 1;
fi
chown root: /opt/worktrack/template.odt /usr/local/bin/worktrack
chmod 0755 /usr/local/bin/worktrack
chmod 0644 /opt/worktrack/template.odt
exec libreoffice --writer ~/Documents/WorkTrack/"$option"/track.doc
;;
*)
echo Usage: $0 '[command]'