/
serggt1
/
scripts
Обзор
Документация
Войти
/
serggt1
/
scripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
examples/install_script.sample
63 строки
1 KB
Sergey Ponomarev
initial commit
02 мар 2011, 12:30
02 мар 2011, 12:30
0c59453
Код
Авторство
О чём код?
#!/bin/bash FILEDIR=`echo "$0" | awk '{str = $0; sub(/\/[^\/]*$/,"",str); print str}'` cd "$FILEDIR" INSTALLDIR=/home/vistar/uploadm NOAUTORUN= function usage { echo "Usage: install [ARGS]"; echo "Optional args:"; echo " -d, --install-dir destination directory path"; echo " -na, --no-autorun do not register in autorun"; exit 1; } function error { echo "Aborting installation because of error" exit 1; } while [ "$1" ]; do case "$1" in "--install-dir"|"-d") if [ "$2" ]; then INSTALLDIR="$2"; shift else usage; fi ;; "--install-dir"|"-d") NOAUTORUN="1"; ;; esac shift done #copy files echo "Copying files..." mkdir $INSTALLDIR/ cp -f -r ./* $INSTALLDIR/ if [ $? -ne 0 ]; then error; fi #import gpg key echo "Importing gpg key" gpg --import misc/verify.key #create autorun script if [ -z $NOAUTORUN ]; then echo "Registering autorun..." cat > ~/.kde/Autostart/uploadm << EOF #!/bin/sh if [ $? -ne 0 ]; then error; fi $INSTALLDIR/run.uploadm & EOF chmod a+x ~/.kde/Autostart/uploadm fi echo "Installation successful."