File: Installme

package info (click to toggle)
asclassic 1.1b-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,508 kB
  • ctags: 1,997
  • sloc: ansic: 21,051; makefile: 397; sh: 356
file content (113 lines) | stat: -rwxr-xr-x 3,286 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
# 08/23/96 fsf ffejes@midway.uchicago.edu
# Boy, I wish zsh or ksh was the standard shell for linux
PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:.
ICONDIR=/usr/include/X11/pixmaps
BACKGROUNDDIR=/usr/lib/X11/asclassic/backgrounds

clear
echo "    ######################################"
echo "    # AfterStepClassic v1.1 Installation #"
echo "    ######################################"
echo "This Installation must be run as root..."
echo "If you are not root, press control-C and"
echo "either login as root or su to root."
echo "Otherwise, press <Enter> and sit back"
echo "while your system is being upgraded to"
echo "AfterStep!"
read OK
echo
echo "Are you using an 8bpp display? (Y/N) - Answer Y if uncertain."
read ANSWER
echo
echo -E "Enter up to ten users who will be using AfterStep (eg, frank dan root):"
echo "  ------------------------------ NOTE ------------------------------"
echo "  Each will receive new .xsession, .xinitrc, .Xdefaults, and .steprc"
echo "  files.  Existing files will be saved and appended with a .before.#"
echo "  extension.  Press <Enter> if you would like to finish without"
echo "  configuring any users."
echo "  ------------------------------------------------------------------"
read users
./MakeMakefiles
make all
make install
make install.man
echo
echo "Installing icons..."
echo
if [ ! $ANSWER = "y" ] && [ ! $ANSWER = "Y" ]; then
  cp ./icons/*.xpm $ICONDIR
else
  cp ./icons/8bit/*.xpm $ICONDIR
fi
chmod 644 $ICONDIR/*.xpm
echo "Installing backgrounds..."
echo
mkdir $BACKGROUNDDIR
cp ./backgrounds/* $BACKGROUNDDIR
chmod 644 $BACKGROUNDDIR/*.jpg
echo "Finished installing the binaries, manpages, and images!"
echo

if [ ! "$users" ]; then 
  echo
  echo "Installation is complete.  If you have had any trouble"
  echo "with this procedure, I can be reached via email at"
  echo "ffejes@midway.uchicago.edu ... Happy stepping!"
  echo
  exit 
fi

for i in $users; do
  if [ -d /home/$i ]; then
    HOMEDIR=/home/$i
  elif [ -d /users/$i ]; then
    HOMEDIR=/users/$i
  else
    echo "Enter the home directory for user $i:"
    read HOMEDIR
  fi
  
  date=`date +%H%M%S`
  
  if [ -d $HOMEDIR ]; then
    echo "Creating a default configuration for $i..."
    if [ -f $HOMEDIR/.xsession ]; then
      mv $HOMEDIR/.xsession $HOMEDIR/.xsession.before.$date
    fi

    if [ -f $HOMEDIR/.xinitrc ]; then
      mv $HOMEDIR/.xinitrc $HOMEDIR/.xinitrc.before.$date
    fi

    if [ -f $HOMEDIR/.Xdefaults ]; then
      mv $HOMEDIR/.Xdefaults $HOMEDIR/.Xdefaults.before.$date
    fi

    if [ -f $HOMEDIR/.steprc ]; then
      mv $HOMEDIR/.steprc $HOMEDIR/.steprc.before.$date
    fi

    cp ./install/xsession $HOMEDIR/.xsession
    chown $i $HOMEDIR/.xsession
    chmod 755 $HOMEDIR/.xsession

    cp ./install/xinitrc $HOMEDIR/.xinitrc
    chown $i $HOMEDIR/.xinitrc
    chmod 755 $HOMEDIR/.xinitrc

    cp ./install/Xdefaults $HOMEDIR/.Xdefaults
    chown $i $HOMEDIR/.Xdefaults

    cp sample.steprc $HOMEDIR/.steprc
    chown $i $HOMEDIR/.steprc
  else 
    echo "User $i does not exist or does not have a home directory."
  fi  
done

echo
echo "Installation is complete.  If you have had any trouble"
echo "with this procedure, I can be reached via email at"
echo "ffejes@midway.uchicago.edu ... Happy stepping!"
echo